Skip to content

Commit e171f9d

Browse files
committed
Move led pulse variables inside led_pulse() function
1 parent f3221b2 commit e171f9d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

app/main.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,7 @@ volatile const uint8_t bootloader_data[] __attribute__ ((section (".bootloader_v
5050

5151
volatile const uint8_t bootloader_identifier[] __attribute__ ((section (".bootloader_identification"), used)) = "MCUboot Arduino";
5252

53-
volatile uint8_t ledKeepValue = 0;
54-
volatile uint8_t ledTargetValue = 20;
55-
volatile int8_t ledDirection = 1;
56-
volatile int divisor = 0;
53+
5754

5855
DigitalOut red(BOARD_RED_LED, 1);
5956
DigitalOut green(BOARD_GREEN_LED, 1);
@@ -78,6 +75,11 @@ static void led_swap_feedback() {
7875
}
7976

8077
static void led_pulse(DigitalOut* led) {
78+
static uint8_t ledKeepValue = 0;
79+
static uint8_t ledTargetValue = 20;
80+
static int8_t ledDirection = 1;
81+
static int divisor = 0;
82+
8183
if (divisor++ % 40) {
8284
return;
8385
}

0 commit comments

Comments
 (0)