mirror of https://github.com/commaai/panda.git
add volatiles to the ring buffer pointers
This commit is contained in:
parent
b35285ba7d
commit
59eaec5dd6
|
@ -3,8 +3,8 @@
|
|||
// CAN3_TX, CAN3_RX0, CAN3_SCE
|
||||
|
||||
typedef struct {
|
||||
uint32_t w_ptr;
|
||||
uint32_t r_ptr;
|
||||
volatile uint32_t w_ptr;
|
||||
volatile uint32_t r_ptr;
|
||||
uint32_t fifo_size;
|
||||
CAN_FIFOMailBox_TypeDef *elems;
|
||||
} can_ring;
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
|
||||
#define FIFO_SIZE 0x400
|
||||
typedef struct uart_ring {
|
||||
uint16_t w_ptr_tx;
|
||||
uint16_t r_ptr_tx;
|
||||
volatile uint16_t w_ptr_tx;
|
||||
volatile uint16_t r_ptr_tx;
|
||||
uint8_t elems_tx[FIFO_SIZE];
|
||||
uint16_t w_ptr_rx;
|
||||
uint16_t r_ptr_rx;
|
||||
volatile uint16_t w_ptr_rx;
|
||||
volatile uint16_t r_ptr_rx;
|
||||
uint8_t elems_rx[FIFO_SIZE];
|
||||
USART_TypeDef *uart;
|
||||
void (*callback)(struct uart_ring*);
|
||||
|
|
Loading…
Reference in New Issue