diff options
Diffstat (limited to 'Src')
| -rw-r--r-- | Src/main-hs.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/Src/main-hs.c b/Src/main-hs.c index 0fe8783..3350135 100644 --- a/Src/main-hs.c +++ b/Src/main-hs.c @@ -259,11 +259,6 @@ int main(void) (uint8_t*)MDR_buf, MDR_len, 1000) != HAL_OK) { if (HAL_I2C_GetError(&hi2c1) != HAL_I2C_ERROR_AF) { hs_sts = HS_FAILED; - } - else if (++AF_error_counter > 1500) { - hs_sts = HS_FAILED; - } - if (hs_sts == HS_FAILED) { #ifdef DEBUG_ENABLE goto __HS_MDR_I2C_ERROR; __HS_MDR_I2C_ERROR_END: @@ -271,17 +266,19 @@ int main(void) #endif break; } + else if (++AF_error_counter > 1500) { + hs_sts = HS_FAILED; + break; + } } - /* if (hs_sts != HS_FAILED) { */ - // TODO Decode the MDR + if (hs_sts != HS_FAILED) { #ifdef TESTING_ENABLE goto __HS_MDR_MDR_TESTING; __HS_MDR_MDR_TESTING_END: __asm__("nop"); #endif - /* } */ - - + + } break; } } @@ -326,7 +323,7 @@ int main(void) for (int x=0; x<MDR_len; x++) { sprintf((char*)debug_buf+x, "%x", MDR_buf[x]); } - uint8_t mdrbuf[] = "Got MDR: \n"; + uint8_t mdrbuf[] = "Got MDR: "; HAL_UART_Transmit(&huart1, mdrbuf, sizeof(mdrbuf), 100); HAL_UART_Transmit(&huart1, debug_buf, sizeof(debug_buf), 100); HAL_UART_Transmit(&huart1, term, 2, 100); |
