only: blink more LEDs

This commit is contained in:
Matthew Kennedy 2024-03-13 03:59:06 -04:00 committed by rusefillc
parent 6298404378
commit 6ec1481f01
1 changed files with 12 additions and 0 deletions

View File

@ -13,16 +13,28 @@ class BlinkyThread : public chibios_rt::BaseStaticThread<256> {
protected:
void main(void) override {
Gpio yellow = getWarningLedPin();
Gpio blue = getCommsLedPin();
Gpio green = getRunningLedPin();
efiSetPadMode("yellow", yellow, PAL_MODE_OUTPUT_PUSHPULL);
efiSetPadMode("blue", blue, PAL_MODE_OUTPUT_PUSHPULL);
efiSetPadMode("green", green, PAL_MODE_OUTPUT_PUSHPULL);
auto yellowPort = getBrainPinPort(yellow);
auto yellowPin = getBrainPinIndex(yellow);
auto bluePort = getBrainPinPort(blue);
auto bluePin = getBrainPinIndex(blue);
auto greenPort = getBrainPinPort(green);
auto greenPin = getBrainPinIndex(green);
palSetPad(yellowPort, yellowPin);
palSetPad(bluePort, bluePin);
palSetPad(greenPort, greenPin);
while (true) {
palTogglePad(yellowPort, yellowPin);
palTogglePad(bluePort, bluePin);
palTogglePad(greenPort, greenPin);
// blink 3 times faster if Dual Bank is not enabled
chThdSleepMilliseconds(isFlashDualBank() ? 250 : 80);
}