[Cryptech-Commits] [user/ft/stm32-dev-bridge] 01/02: remove case-specific test code accidentally committed

git at cryptech.is git at cryptech.is
Thu Oct 15 10:50:14 UTC 2015


This is an automated email from the git hooks/post-receive script.

fredrik at thulin.net pushed a commit to branch master
in repository user/ft/stm32-dev-bridge.

commit df9f91df317eefd05694f947b019ebceb141e746
Author: Fredrik Thulin <fredrik at thulin.net>
Date:   Thu Oct 15 10:19:32 2015 +0200

    remove case-specific test code accidentally committed
---
 src/short-test/src/main.c | 43 +------------------------------------------
 1 file changed, 1 insertion(+), 42 deletions(-)

diff --git a/src/short-test/src/main.c b/src/short-test/src/main.c
index 6e944c9..ee1fedb 100644
--- a/src/short-test/src/main.c
+++ b/src/short-test/src/main.c
@@ -22,8 +22,6 @@ void uart_send_binary(uint32_t num, uint8_t bits);
 
 #define DELAY() HAL_Delay(100)
 
-#define DEBUG_ADJACENT 0
-
 //------------------------------------------------------------------------------
 // Macros
 //------------------------------------------------------------------------------
@@ -74,28 +72,6 @@ main()
   __GPIOH_CLK_ENABLE();
   __GPIOI_CLK_ENABLE();
 
-  configure_all_as_input(GPIOB, GPIOB_PINS);
-  configure_all_as_input(GPIOD, GPIOD_PINS);
-  configure_all_as_input(GPIOE, GPIOE_PINS);
-  configure_all_as_input(GPIOF, GPIOF_PINS);
-  configure_all_as_input(GPIOG, GPIOG_PINS);
-  configure_all_as_input(GPIOH, GPIOH_PINS);
-  configure_all_as_input(GPIOI, GPIOI_PINS);
-
-  /* Change one pin to output */
-  GPIO_InitStruct.Pin = GPIO_PIN_12 | GPIO_PIN_11;
-  GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
-  GPIO_InitStruct.Pull = GPIO_PULLUP;
-  GPIO_InitStruct.Speed = GPIO_SPEED_HIGH;
-  HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
-
-  while (1) {
-    HAL_GPIO_WritePin(GPIOD, GPIO_PIN_11, GPIO_PIN_SET);
-    HAL_GPIO_WritePin(GPIOD, GPIO_PIN_12, GPIO_PIN_SET);
-    HAL_GPIO_WritePin(GPIOD, GPIO_PIN_11, GPIO_PIN_RESET);
-    HAL_GPIO_WritePin(GPIOD, GPIO_PIN_12, GPIO_PIN_RESET);
-  }
-
   while (1) {
     HAL_GPIO_TogglePin(LED_PORT, LED_GREEN);
     HAL_UART_Transmit(&huart2, (uint8_t *) "\r\n\r\n\r\n\r\n\r\n", 10, 0x1);
@@ -107,7 +83,6 @@ main()
     test_for_shorts('G', GPIOG, GPIOG_PINS);
     test_for_shorts('H', GPIOH, GPIOH_PINS);
     test_for_shorts('I', GPIOI, GPIOI_PINS);
-
     led_toggle(LED_BLUE);
     HAL_Delay(2000);
   }
@@ -133,14 +108,6 @@ uint8_t check_no_input(char port, GPIO_TypeDef* GPIOx, uint16_t GPIO_Test_Pins,
   /* Read all pins from port at once. XXX check all pins, not just GPIO_Test_Pins? */
   read = (GPIOx->IDR & GPIO_Test_Pins);
 
-  if (DEBUG_ADJACENT && port == 'H' && wrote_port == 'I' && wrote_value < 4) {
-    HAL_UART_Transmit(&huart2, (uint8_t *) "DEBUG R GPIOH ", 14, 0x1);
-    uart_send_binary(GPIO_Test_Pins, 16);
-    HAL_UART_Transmit(&huart2, (uint8_t *) " -> ", 4, 0x1);
-    uart_send_binary(read, 16);
-    HAL_UART_Transmit(&huart2, (uint8_t *) "\r\n", 2, 0x1);
-  }
-
   if (! read) {
     /* No unexpected pins read as HIGH */
     return 0;
@@ -201,17 +168,9 @@ void test_for_shorts(char port, GPIO_TypeDef* GPIOx, uint16_t GPIO_Test_Pins)
 
     HAL_GPIO_WritePin(GPIOx, Test_Pin, GPIO_PIN_SET);
 
-    /* Read all pins from port at once. XXX check all pins, not just GPIO_Test_Pins? */
+    /* Read all input GPIOs from port at once. XXX check all pins, not just GPIO_Test_Pins? */
     read = GPIOx->IDR & GPIO_Test_Pins;
 
-    if (DEBUG_ADJACENT && port == 'I' && Test_Pin < 4) {
-      HAL_UART_Transmit(&huart2, (uint8_t *) "DEBUG W GPIOI ", 14, 0x1);
-      uart_send_binary(Test_Pin, 16);
-      HAL_UART_Transmit(&huart2, (uint8_t *) " -> ", 4, 0x1);
-      uart_send_binary(read, 16);
-      HAL_UART_Transmit(&huart2, (uint8_t *) "\r\n", 2, 0x1);
-    }
-
     if (read == Test_Pin) {
       /* No unexpected pins read as HIGH */
       led_toggle(LED_GREEN);



More information about the Commits mailing list