diff options
| author | Aditya Naik | 2020-03-25 16:22:29 -0400 |
|---|---|---|
| committer | Aditya Naik | 2020-03-25 16:22:29 -0400 |
| commit | b26368979741bd936f0dbbf037ef8ec5d03d2338 (patch) | |
| tree | 3f473883c20ee0c66e34d0d83f4637a8231f0977 | |
| parent | 9320bd2d2516d62e8db13e853222e86608a09471 (diff) | |
Debugging AF errors on MDK ACK
| -rw-r--r-- | Src/main.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -156,8 +156,8 @@ int main(void) HAL_GPIO_TogglePin(led_GPIO_Port, led_Pin);
uint8_t MDR_ACK_buf[8] = {0};
-
- if (HAL_I2C_Master_Receive(&hi2c1, (uint8_t)I2C_ADDRESS, (uint8_t*)MDR_ACK_buf, 2, 10000) != HAL_OK) {
+ HAL_Delay(100);
+ if (HAL_I2C_Master_Receive(&hi2c1, (uint8_t)I2C_ADDRESS, (uint8_t*)MDR_ACK_buf, 3, 10000) != HAL_OK) {
#ifdef DEBUG_ENABLE
sprintf((char*)debug_buf, "Unable to get MDR ACK. I2C error: %ld\r\n", HAL_I2C_GetError(&hi2c1));
HAL_UART_Transmit(&huart1, debug_buf, sizeof(debug_buf), 100);
@@ -165,6 +165,7 @@ int main(void) #endif /* DEBUG_ENABLE */
}
+
#ifdef TESTING_ENABLE
uint8_t bufbuf2[] = "MDR ACK buffer: ";
HAL_UART_Transmit(&huart1, bufbuf2, sizeof(bufbuf2), 100);
@@ -291,7 +292,7 @@ int main(void) HAL_GPIO_TogglePin(led_GPIO_Port, led_Pin);
- if (HAL_I2C_Slave_Transmit(&hi2c1, (uint8_t*)MDR_ACK_buf, 2, 1000) != HAL_OK) {
+ if (HAL_I2C_Slave_Transmit(&hi2c1, (uint8_t*)MDR_ACK_buf, 2, 10000) != HAL_OK) {
#ifdef DEBUG_ENABLE
sprintf((char*)debug_buf, "Unable to send MDR ACK. I2C error: %ld\r\n", HAL_I2C_GetError(&hi2c1));
HAL_UART_Transmit(&huart1, debug_buf, sizeof(debug_buf), 100);
|
