Skip to content

Commit

Permalink
Use Red LED to indicate error/failure. Blue to indicate freeze mode
Browse files Browse the repository at this point in the history
  • Loading branch information
danngreen committed Oct 14, 2024
1 parent d5dfa75 commit 3b2378a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@

void main()
{
Board::OrangeLED led;
Board::RedLED red_led;
Board::BlueLED blue_led;
red_led.off();
blue_led.on();

auto clockspeed = SystemClocks::init_core_clocks(Board::HSE_Clock_Hz, Board::MPU_MHz, Board::ClockType);
security_init();
Expand Down Expand Up @@ -69,6 +72,7 @@ void main()
BootMediaLoader loader{boot_method};
bool image_ok = loader.load_image(image_type);

blue_led.off();
if (image_ok) {
print("Jumping to app\n");
loader.boot_image();
Expand All @@ -78,9 +82,9 @@ void main()
print("FAILED!\n");
constexpr uint32_t dlytime = 50000;
while (true) {
led.on();
red_led.on();
udelay(dlytime);
led.off();
red_led.off();
udelay(dlytime);
}
}
Expand Down

0 comments on commit 3b2378a

Please sign in to comment.