Commit bd5152c9 authored by Damien George's avatar Damien George

stm32/mboot: Add board-configurable SysTick hook.

Signed-off-by: default avatarDamien George <damien@micropython.org>
parent 313f0828
......@@ -1518,9 +1518,9 @@ void SysTick_Handler(void) {
// work properly.
SysTick->CTRL;
// Update the LED0 state from here to ensure it's consistent regardless of
// Run any board-specific code that needs to be done regardless of
// other processing going on in interrupts or main.
led0_update();
MBOOT_BOARD_SYSTICK();
}
#if defined(MBOOT_I2C_SCL)
......
......@@ -54,6 +54,10 @@
#define MBOOT_BOARD_STATE_CHANGE(state, arg) mboot_state_change_default((state), (arg))
#endif
#ifndef MBOOT_BOARD_SYSTICK
#define MBOOT_BOARD_SYSTICK() mboot_ui_systick()
#endif
#ifndef MBOOT_ADDRESS_SPACE_64BIT
#define MBOOT_ADDRESS_SPACE_64BIT (0)
#endif
......@@ -148,7 +152,7 @@ extern uint8_t _estack[ELEM_DATA_SIZE];
void systick_init(void);
void led_init(void);
void led0_update(void);
void mboot_ui_systick(void);
void SystemClock_Config(void);
uint32_t get_le32(const uint8_t *b);
......
......@@ -122,7 +122,7 @@ void led0_state(led0_state_t state) {
}
}
void led0_update(void) {
void mboot_ui_systick(void) {
if (led0_cur_state != LED0_STATE_OFF && systick_ms - led0_ms_interval > 50) {
uint8_t rate = (led0_cur_state >> 2) & 0x1f;
led0_ms_interval += 50;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment