Skip to content

Commit f3221b2

Browse files
committed
Uniform LED related function names
1 parent 1daa19a commit f3221b2

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

app/main.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,19 @@ Ticker swap_ticker;
6565

6666
bool debug_enabled = false;
6767

68-
static inline void swap_feedback() {
68+
static void led_swap_feedback_off(void) {
69+
swap_ticker.detach();
70+
red = 1;
71+
green = 1;
72+
blue = 1;
73+
}
74+
75+
static void led_swap_feedback() {
6976
blue = !blue;
7077
red = !red;
7178
}
7279

73-
static inline void LED_pulse(DigitalOut* led)
74-
{
80+
static void led_pulse(DigitalOut* led) {
7581
if (divisor++ % 40) {
7682
return;
7783
}
@@ -109,13 +115,7 @@ int target_debug_init(void) {
109115
return 0;
110116
}
111117

112-
int target_led_off(void) {
113-
swap_ticker.detach();
114-
red = 1;
115-
green = 1;
116-
blue = 1;
117-
return 0;
118-
}
118+
119119

120120
#if MCUBOOT_APPLICATION_DFU
121121
USBD_HandleTypeDef USBD_Device;
@@ -132,7 +132,7 @@ static int start_dfu(void) {
132132
SetSysClock_PLL_HSE(1, false);
133133
SystemCoreClockUpdate();
134134

135-
target_led_off();
135+
led_swap_feedback_off();
136136

137137
//turnDownEthernet();
138138

@@ -170,7 +170,7 @@ static int start_dfu(void) {
170170
HAL_PCD_IRQHandler(&hpcd);
171171
}
172172
#endif
173-
LED_pulse(&green);
173+
led_pulse(&green);
174174
}
175175

176176
return 0;
@@ -197,7 +197,7 @@ int start_secure_application(void) {
197197
return -1;
198198
}
199199

200-
target_led_off();
200+
led_swap_feedback_off();
201201

202202
// Run the application in the primary slot
203203
// Add header size offset to calculate the actual start address of application
@@ -279,7 +279,7 @@ int main(void) {
279279

280280
} else {
281281
/* MCUboot secure boot */
282-
swap_ticker.attach(&swap_feedback, 250ms);
282+
swap_ticker.attach(&led_swap_feedback, 250ms);
283283
RTCSetBKPRegister(RTC_BKP_DR0, 0);
284284
start_secure_application();
285285
}

0 commit comments

Comments
 (0)