Skip to content

Commit 52ed65a

Browse files
authored
Merge pull request #42 from TT-ZX/main
Fix bug where buffers are not initialised.
2 parents ae6ccad + b000df6 commit 52ed65a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

STM32_CAN.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ to same folder with sketch and haven #define HAL_CAN_MODULE_ENABLED there. See e
3232
#if defined(STM32F0xx)
3333
#define CAN1_TX_IRQn CEC_CAN_IRQn
3434
#define CAN1_RX0_IRQn CEC_CAN_IRQn
35+
#define CAN1_RX0_IRQHandler CEC_CAN_IRQHandler
3536
#endif
3637

3738
#include <Arduino.h>
@@ -193,8 +194,8 @@ class STM32_CAN {
193194
uint8_t timeseg2, uint8_t sjw);
194195
uint32_t getAPB1Clock(void);
195196

196-
volatile CAN_message_t *rx_buffer;
197-
volatile CAN_message_t *tx_buffer;
197+
volatile CAN_message_t *rx_buffer = nullptr;
198+
volatile CAN_message_t *tx_buffer = nullptr;
198199

199200
static constexpr Baudrate_entry_t BAUD_RATE_TABLE_48M[] {
200201
{

0 commit comments

Comments
 (0)