Skip to content

Commit

Permalink
OpenBLT yellow blinker rusefi#5901
Browse files Browse the repository at this point in the history
  • Loading branch information
andreika-git committed Feb 1, 2024
1 parent 21e698f commit 6e88870
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions firmware/bootloader/bootloader_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,36 @@ extern "C" {
#include "shared_params.h"
}

class BlinkyThread : public chibios_rt::BaseStaticThread<256> {
protected:
void main(void) override {
Gpio yellow = getWarningLedPin();

efiSetPadMode("yellow", yellow, PAL_MODE_OUTPUT_PUSHPULL);

auto yellowPort = getBrainPinPort(yellow);
auto yellowPin = getBrainPinIndex(yellow);

palSetPad(yellowPort, yellowPin);

while (true) {
palTogglePad(yellowPort, yellowPin);
chThdSleepMilliseconds(250);
}
}
};

static BlinkyThread blinky;

int main(void) {
halInit();
chSysInit();

baseMCUInit();

// start the blinky thread
blinky.start(NORMALPRIO + 10);

// Init openblt shared params
SharedParamsInit();

Expand Down

0 comments on commit 6e88870

Please sign in to comment.