bootloader tolerates missing pins

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

View File

@ -27,14 +27,26 @@ protected:
auto greenPort = getBrainPinPort(green);
auto greenPin = getBrainPinIndex(green);
palSetPad(yellowPort, yellowPin);
palSetPad(bluePort, bluePin);
palSetPad(greenPort, greenPin);
if (yellowPort) {
palSetPad(yellowPort, yellowPin);
}
if (bluePort) {
palSetPad(bluePort, bluePin);
}
if (greenPort) {
palSetPad(greenPort, greenPin);
}
while (true) {
palTogglePad(yellowPort, yellowPin);
palTogglePad(bluePort, bluePin);
palTogglePad(greenPort, greenPin);
if (yellowPort) {
palTogglePad(yellowPort, yellowPin);
}
if (bluePort) {
palTogglePad(bluePort, bluePin);
}
if (greenPort) {
palTogglePad(greenPort, greenPin);
}
// blink 3 times faster if Dual Bank is not enabled
chThdSleepMilliseconds(isFlashDualBank() ? 250 : 80);
}