Skip to content

Commit 220abca

Browse files
committed
stmhal: Use LED constants from PYBv4 onwards.
1 parent 30beed1 commit 220abca

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

stmhal/main.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,14 @@ mp_vfs_mount_t mp_vfs_mount_flash;
7272

7373
void flash_error(int n) {
7474
for (int i = 0; i < n; i++) {
75-
led_state(PYB_LED_R1, 1);
76-
led_state(PYB_LED_R2, 0);
75+
led_state(PYB_LED_RED, 1);
76+
led_state(PYB_LED_GREEN, 0);
7777
HAL_Delay(250);
78-
led_state(PYB_LED_R1, 0);
79-
led_state(PYB_LED_R2, 1);
78+
led_state(PYB_LED_RED, 0);
79+
led_state(PYB_LED_GREEN, 1);
8080
HAL_Delay(250);
8181
}
82-
led_state(PYB_LED_R2, 0);
82+
led_state(PYB_LED_GREEN, 0);
8383
}
8484

8585
void NORETURN __fatal_error(const char *msg) {
@@ -183,7 +183,7 @@ MP_NOINLINE STATIC void init_flash_fs(uint reset_mode) {
183183
// no filesystem, or asked to reset it, so create a fresh one
184184

185185
// LED on to indicate creation of LFS
186-
led_state(PYB_LED_R2, 1);
186+
led_state(PYB_LED_GREEN, 1);
187187
uint32_t start_tick = HAL_GetTick();
188188

189189
uint8_t working_buf[_MAX_SS];
@@ -218,7 +218,7 @@ MP_NOINLINE STATIC void init_flash_fs(uint reset_mode) {
218218

219219
// keep LED on for at least 200ms
220220
sys_tick_wait_at_least(start_tick, 200);
221-
led_state(PYB_LED_R2, 0);
221+
led_state(PYB_LED_GREEN, 0);
222222
} else if (res == FR_OK) {
223223
// mount sucessful
224224
} else {
@@ -245,7 +245,7 @@ MP_NOINLINE STATIC void init_flash_fs(uint reset_mode) {
245245
// doesn't exist, create fresh file
246246

247247
// LED on to indicate creation of boot.py
248-
led_state(PYB_LED_R2, 1);
248+
led_state(PYB_LED_GREEN, 1);
249249
uint32_t start_tick = HAL_GetTick();
250250

251251
FIL fp;
@@ -257,7 +257,7 @@ MP_NOINLINE STATIC void init_flash_fs(uint reset_mode) {
257257

258258
// keep LED on for at least 200ms
259259
sys_tick_wait_at_least(start_tick, 200);
260-
led_state(PYB_LED_R2, 0);
260+
led_state(PYB_LED_GREEN, 0);
261261
}
262262
}
263263

stmhal/storage.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ static uint8_t *flash_cache_get_addr_for_write(uint32_t flash_addr) {
149149
flash_cache_sector_size = flash_sector_size;
150150
}
151151
flash_flags |= FLASH_FLAG_DIRTY;
152-
led_state(PYB_LED_R1, 1); // indicate a dirty cache with LED on
152+
led_state(PYB_LED_RED, 1); // indicate a dirty cache with LED on
153153
flash_tick_counter_last_write = HAL_GetTick();
154154
return (uint8_t*)CACHE_MEM_START_ADDR + flash_addr - flash_sector_start;
155155
}
@@ -261,7 +261,7 @@ void storage_irq_handler(void) {
261261
// clear the flash flags now that we have a clean cache
262262
flash_flags = 0;
263263
// indicate a clean cache with LED off
264-
led_state(PYB_LED_R1, 0);
264+
led_state(PYB_LED_RED, 0);
265265
}
266266

267267
#endif

0 commit comments

Comments
 (0)