Pre-OTA Flash Function?

Is there any sort of function in the Core firmware itself that can be called before an OTA flash occurs? A use case would be to perform RGB.control(false); (or disable other LEDs/sensors) before it starts the OTA flash so that I can see the familiar blinking magenta instead of it initially blinking whatever RGB.color(...) (or lack thereof) was last set in user code. If I’m using a bigger RGB LED in close proximity to the Core, I typically disable the onboard RGB LED so the colors don’t clash. I also tend to disable the onboard LED when I want to put the Core in a bedroom so it doesn’t keep the kids up at night!

1 Like

I guess you can but involves changing code in the bootloader based on what i see…

Perhaps the OTA code should re-take control of the RGB leds since the user code will most likely turn them off again once the OTA is done and the code runs.

Another use case would be to put any peripherals into a mode suitable for OTA. Such as a relay board. If my relay is in the process of controlling something like a sprinkler, and I do a flash, I’d want the ability to turn off the sprinkler first so that if the flash fails for some reason, my sprinkler doesn’t get stuck on and flood my basement. :smile:

1 Like

Same here. I’d rather not flood your basement, either.