Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow sample apps to override BaseApplication's default lcd screen #31603

Merged
merged 3 commits into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions examples/platform/silabs/BaseApplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -458,11 +458,7 @@ void BaseApplication::ButtonHandler(AppEvent * aEvent)
// - Cycle LCD screen
CancelFunctionTimer();

OutputQrCode(false);
#ifdef DISPLAY_ENABLED
UpdateLCDStatusScreen();
slLCD.CycleScreens();
#endif
AppTask::GetAppTask().UpdateDisplay();
mykrupp marked this conversation as resolved.
Show resolved Hide resolved

#ifdef SL_WIFI
if (!ConnectivityMgr().IsWiFiStationProvisioned())
Expand Down Expand Up @@ -493,6 +489,15 @@ void BaseApplication::ButtonHandler(AppEvent * aEvent)
}
}

void BaseApplication::UpdateDisplay()
{
OutputQrCode(false);
#ifdef DISPLAY_ENABLED
UpdateLCDStatusScreen();
slLCD.CycleScreens();
#endif
}

void BaseApplication::CancelFunctionTimer()
{
if (xTimerStop(sFunctionTimer, pdMS_TO_TICKS(0)) == pdFAIL)
Expand Down
5 changes: 5 additions & 0 deletions examples/platform/silabs/BaseApplication.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ class BaseApplication
*/
static void PostEvent(const AppEvent * event);

/**
* @brief Overridable function used to update display on button press
*/
virtual void UpdateDisplay();

#ifdef DISPLAY_ENABLED
/**
* @brief Return LCD object
Expand Down
2 changes: 1 addition & 1 deletion examples/platform/silabs/display/lcd.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ class SilabsLCD
void SetScreen(Screen_e screen);
void CycleScreens(void);
void SetStatus(DisplayStatus_t & status);
void WriteStatus();

#ifdef QR_CODE_ENABLED
void SetQRCode(uint8_t * str, uint32_t size);
Expand All @@ -85,7 +86,6 @@ class SilabsLCD
} DemoState_t;

void WriteDemoUI();
void WriteStatus();

#ifdef QR_CODE_ENABLED
void WriteQRCode();
Expand Down
Loading