Move main UART RX callback to main.c
This commit is contained in:
parent
839a9a930a
commit
e58b9ffae0
@ -11,6 +11,7 @@
|
||||
#include "common_defs.h"
|
||||
|
||||
#include "stm32f4xx_hal.h"
|
||||
#include "stm32f4xx_hal_uart.h"
|
||||
|
||||
extern volatile uint16_t temperatures[N_CELLS];
|
||||
|
||||
@ -42,4 +43,6 @@ HAL_StatusTypeDef tmp144_read_temps();
|
||||
HAL_StatusTypeDef tmp144_send_read_temps(TMP144Bus* bus);
|
||||
HAL_StatusTypeDef tmp144_recv_temps(TMP144Bus* bus);
|
||||
|
||||
void tmp144_handle_rx_cplt(UART_HandleTypeDef* handle);
|
||||
|
||||
#endif /* INC_TMP144_H_ */
|
||||
|
@ -179,7 +179,7 @@ HAL_StatusTypeDef tmp144_recv_temps(TMP144Bus* bus) {
|
||||
return HAL_OK;
|
||||
}
|
||||
|
||||
void HAL_UART_RxCpltCallback(UART_HandleTypeDef* handle) {
|
||||
void tmp144_handle_rx_cplt(UART_HandleTypeDef* handle) {
|
||||
TMP144Bus* bus;
|
||||
if (handle == bus_busbar.handle) {
|
||||
bus = &bus_busbar;
|
||||
|
@ -24,10 +24,12 @@
|
||||
#include "BQ_Abstraction_Layer.h"
|
||||
#include "EEPROM.h"
|
||||
#include "FanControl.h"
|
||||
#include "TMP144.h"
|
||||
|
||||
#include "stm32f4xx_hal.h"
|
||||
#include "stm32f4xx_hal_gpio.h"
|
||||
#include "stm32f4xx_hal_tim.h"
|
||||
#include "stm32f4xx_hal_uart.h"
|
||||
/* USER CODE END Includes */
|
||||
|
||||
/* Private typedef -----------------------------------------------------------*/
|
||||
@ -514,7 +516,11 @@ static void MX_GPIO_Init(void) {
|
||||
}
|
||||
|
||||
/* USER CODE BEGIN 4 */
|
||||
|
||||
void HAL_UART_RxCpltCallback(UART_HandleTypeDef* handle) {
|
||||
if (handle == &huart1 || handle == &huart3) {
|
||||
tmp144_handle_rx_cplt(handle);
|
||||
}
|
||||
}
|
||||
/* USER CODE END 4 */
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user