summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAditya Naik2020-04-07 02:53:45 -0400
committerAditya Naik2020-04-07 02:53:45 -0400
commite4b1a44ab174c12cbf9ade2bc6217cd1f2de39e1 (patch)
tree0cce51148d37889ed17024a209f4fb45094cf42e
parented665c2a448aa8b9087bb020a18e9f6bee631e6e (diff)
Debug/testing block corrections
-rw-r--r--Inc/config.h4
-rw-r--r--Src/main-hs.c6
2 files changed, 6 insertions, 4 deletions
diff --git a/Inc/config.h b/Inc/config.h
index 7e4f53b..cfd2817 100644
--- a/Inc/config.h
+++ b/Inc/config.h
@@ -1,6 +1,6 @@
/* Enable debug mode */
-#define DEBUG_ENABLE 1
+/* #define DEBUG_ENABLE 1 */
/* Enable testing mode with granualar status notifications */
-#define TESTING_ENABLE 1
+/* #define TESTING_ENABLE 1 */
diff --git a/Src/main-hs.c b/Src/main-hs.c
index 75de218..460148d 100644
--- a/Src/main-hs.c
+++ b/Src/main-hs.c
@@ -418,9 +418,11 @@ int handshake(uint32_t i2c_addr)
if (HAL_I2C_Master_Transmit(&hi2c1, (uint16_t)i2c_addr,
(uint8_t*)MDR_CTS_buf, 2, 10000) != HAL_OK) {
hs_sts = HS_FAILED;
+#ifdef DEBUG_ENABLE
goto __HS_CTS_I2C_ERROR;
__HS_CTS_I2C_ERROR_END:
__asm__("nop");
+#endif DEBUG_ENABLE
}
else {
hs_sts = HS_MDR_MDR;
@@ -525,8 +527,8 @@ int handshake(uint32_t i2c_addr)
memset(debug_buf, 0, 128);
goto __HS_MDR_MDR_TESTING_END;
__MDR_DEC_TESTING:
- sprintf((char*)debug_buf, "MDR Decode success\r\n\tFirst subscibed module: %d\r\n\tSubs size: %d\r\n",
- subs_info[dev_idx]->module_ids[1], sizeof(subscription_info_t));
+ sprintf((char*)debug_buf, "MDR Decode success\r\n\tFirst subscibed module: %d\r\n",
+ subs_info[dev_idx]->module_ids[1]);
HAL_UART_Transmit(&huart1, debug_buf, sizeof(debug_buf), 100);
memset(debug_buf, 0, 128);
goto __MDR_DEC_TESTING_END;