added delayed error message when hackrf cpld initialization fails (#1887)

* added delayed error message when hackrf cpld initialization fails

* refactoring
This commit is contained in:
Bernd Herzog 2024-02-13 13:06:47 +01:00 committed by GitHub
parent 1139b22141
commit 918ec0574f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 45 additions and 19 deletions

View file

@ -44,6 +44,8 @@ using namespace lpc43xx;
#include "ui_navigation.hpp"
static int delayed_error = 0;
extern "C" {
CH_IRQ_HANDLER(M4Core_IRQHandler) {
@ -161,6 +163,10 @@ void EventDispatcher::dispatch(const eventmask_t events) {
}
if (events & EVT_MASK_RTC_TICK) {
// delay error message by 2 seconds to wait for LCD being ready
if (portapack::init_error != nullptr && ++delayed_error > 1)
draw_guru_meditation(CORTEX_M4, portapack::init_error);
handle_rtc_tick();
}