From 6a459af6241d82940fcc945eaee9d00126d4c667 Mon Sep 17 00:00:00 2001 From: yaapu Date: Sun, 19 Sep 2021 23:38:53 +0200 Subject: [PATCH] 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 --- libraries/AP_OSD/AP_OSD_MSP_DisplayPort.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libraries/AP_OSD/AP_OSD_MSP_DisplayPort.cpp b/libraries/AP_OSD/AP_OSD_MSP_DisplayPort.cpp index f2d14bb1a1..6060eb309e 100644 --- a/libraries/AP_OSD/AP_OSD_MSP_DisplayPort.cpp +++ b/libraries/AP_OSD/AP_OSD_MSP_DisplayPort.cpp @@ -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; } }