Skip to content

Commit da430c1

Browse files
committed
Don't use volatile variables
1 parent ec7493a commit da430c1

File tree

5 files changed

+17
-17
lines changed

5 files changed

+17
-17
lines changed

Diff for: display/ks0108.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include <avr/pgmspace.h>
66
#include "../pins.h"
77

8-
static volatile uint8_t pins;
8+
static uint8_t pins;
99

1010
#ifdef _KS0108B
1111
#define KS0108_SET_CS1(); \

Diff for: display/st7920.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include <util/delay.h>
66
#include "../pins.h"
77

8-
static volatile uint8_t pins;
8+
static uint8_t pins;
99

1010
static uint8_t fb[ST7920_SIZE_X / 4][ST7920_SIZE_Y / 2];
1111
static uint8_t _br;

Diff for: fft.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ static const uint8_t sinTable[] PROGMEM = {
88
180, 162, 142, 120, 98, 74, 50, 25
99
};
1010

11-
#define mshf_16( a, b) \
11+
#define mshf_16( a, b) \
1212
({ \
1313
int prod, val1=a, val2=b; \
1414
__asm__ __volatile__ ( \

Diff for: input.c

+12-12
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,26 @@
88
#include "eeprom.h"
99
#include "pins.h"
1010

11-
static volatile int8_t encCnt = 0;
12-
static volatile CmdID cmdBuf = CMD_END;
11+
static int8_t encCnt = 0;
12+
static CmdID cmdBuf = CMD_END;
1313
static int8_t encRes = 0;
1414
static uint8_t silenceTime;
1515

1616
// Previous state
17-
static volatile uint8_t encPrev = ENC_NO;
18-
static volatile uint8_t btnPrev = BTN_NO;
17+
static uint8_t encPrev = ENC_NO;
18+
static uint8_t btnPrev = BTN_NO;
1919

20-
static volatile uint16_t displayTime = 0; // Display mode timer
21-
static volatile int16_t initTimer = INIT_TIMER_OFF; // Init timer
22-
static volatile uint8_t clockTimer = 0; // RTC poll timer
20+
static uint16_t displayTime = 0; // Display mode timer
21+
static int16_t initTimer = INIT_TIMER_OFF; // Init timer
22+
static uint8_t clockTimer = 0; // RTC poll timer
2323

2424
#ifdef _TEMPCONTROL
25-
static volatile uint16_t sensTimer; // Timer of temperature measuring process
25+
static uint16_t sensTimer; // Timer of temperature measuring process
2626
#endif
27-
static volatile int16_t stbyTimer = STBY_TIMER_OFF; // Standby timer
28-
static volatile uint16_t secTimer; // 1 second timer
29-
static volatile int16_t silenceTimer; // Timer to check silence
30-
static volatile uint16_t rcTimer;
27+
static int16_t stbyTimer = STBY_TIMER_OFF; // Standby timer
28+
static uint16_t secTimer; // 1 second timer
29+
static int16_t silenceTimer; // Timer to check silence
30+
static uint16_t rcTimer;
3131

3232
static uint8_t rcType;
3333
static uint8_t rcAddr;

Diff for: remote.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
#include <avr/interrupt.h>
44
#include "pins.h"
55

6-
static volatile IRData irData; // Last decoded IR command
7-
static volatile uint8_t ovfCnt = 250; // Overflow counter
6+
static IRData irData; // Last decoded IR command
7+
static uint8_t ovfCnt = 250; // Overflow counter
88

99
void rcInit()
1010
{

0 commit comments

Comments
 (0)