From 1fa9d63ac5f2bd1d46edc5d136f8c43ef96bbb68 Mon Sep 17 00:00:00 2001 From: Allen Hill Date: Fri, 15 May 2026 21:46:49 +0000 Subject: [PATCH] Add some missing volatile annotations --- src/avclandrv.c | 6 +++--- src/com232.c | 2 +- src/com232.h | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/avclandrv.c b/src/avclandrv.c index a7f1806..a5d5195 100644 --- a/src/avclandrv.c +++ b/src/avclandrv.c @@ -128,11 +128,11 @@ uint8_t *cd_Time_Sec; cd_modes CD_Mode; #ifdef SOFTWARE_DEBUG -uint8_t pulse_count = 0; -uint16_t period = 0; +volatile uint8_t pulse_count = 0; +volatile uint16_t period = 0; #endif -uint16_t pulsewidth; +volatile uint16_t pulsewidth; // answers uint8_t lancheck_resp[] = {0x00, dev_COMM_CTRL, dev_LAN, 0xFF, 0xFF}; diff --git a/src/com232.c b/src/com232.c index 3a5af2b..40f6d6f 100644 --- a/src/com232.c +++ b/src/com232.c @@ -37,7 +37,7 @@ #define USART_BAUD_RATE(BAUD_RATE) \ (uint16_t)((float)(F_CPU * 64 / (RXMODE_S * (float)BAUD_RATE)) + 0.5) -uint8_t RS232_RxCharBuffer[25], RS232_RxCharBegin, RS232_RxCharEnd; +volatile uint8_t RS232_RxCharBuffer[25], RS232_RxCharBegin, RS232_RxCharEnd; void RS232_Init(void) { RS232_RxCharBegin = RS232_RxCharEnd = 0; diff --git a/src/com232.h b/src/com232.h index 067d33d..e68fd54 100644 --- a/src/com232.h +++ b/src/com232.h @@ -25,7 +25,8 @@ #include -extern uint8_t RS232_RxCharBuffer[25], RS232_RxCharBegin, RS232_RxCharEnd; +extern volatile uint8_t RS232_RxCharBuffer[25], RS232_RxCharBegin, + RS232_RxCharEnd; void RS232_Init(void); void RS232_Print_P(const char *str_addr);