AP_OSD: decrease blink frequency from 2Hz to 1Hz on MSP DisplayPort

Allows to actually see the blinking on hardware with a slow screen refresh rate
This commit is contained in:
yaapu 2021-09-19 23:38:53 +02:00 committed by Peter Barker
parent 9acfdaaa19
commit 6a459af624
1 changed files with 3 additions and 2 deletions

View File

@ -55,10 +55,11 @@ void AP_OSD_MSP_DisplayPort::clear(void)
// clear remote MSP screen
_displayport->msp_displayport_clear_screen();
// toggle flashing @2Hz
// toggle flashing @1Hz
const uint32_t now = AP_HAL::millis();
if (((now / 500) & 0x01) != _blink_on) {
if ((uint32_t(now * 0.004) & 0x01) != _blink_on) {
_blink_on = !_blink_on;
blink_phase = (blink_phase+1)%4;
}
}