From 01ecb27f9962b56bb262a7309eb9c46ec341fd1c Mon Sep 17 00:00:00 2001 From: Dragon-Knight Date: Mon, 21 Oct 2024 04:06:26 +0300 Subject: [PATCH] Use callback --- include/BMSLogic.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/BMSLogic.h b/include/BMSLogic.h index 3b8d2dd..51ee38c 100644 --- a/include/BMSLogic.h +++ b/include/BMSLogic.h @@ -57,8 +57,12 @@ namespace BMSLogic uart_data[BMS_1].hal = &hBms1Uart; uart_data[BMS_2].hal = &hBms2Uart; + Ant1.SetReadyCallback( CANLib::UpdateCANObjects_BMS ); + //Ant2.SetReadyCallback(); + Bms.SetModel(BMS_1, Ant1); Bms.SetModel(BMS_2, Ant2); + HAL_UARTEx_ReceiveToIdle_IT(uart_data[BMS_1].hal, uart_data[BMS_1].hot, sizeof(uart_data[BMS_1].hot)); HAL_UARTEx_ReceiveToIdle_IT(uart_data[BMS_2].hal, uart_data[BMS_2].hot, sizeof(uart_data[BMS_2].hot));