Skip to content

Commit

Permalink
Fixed LCD animations for window-app
Browse files Browse the repository at this point in the history
  • Loading branch information
arun-silabs committed Oct 10, 2023
1 parent 555eed5 commit e6b445a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
3 changes: 2 additions & 1 deletion examples/window-app/silabs/include/WindowManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ class WindowManager

LEDWidget mStatusLED;
LEDWidget mActionLED;

// Get QR Code and emulate its content using NFC tag
char mQRCodeBuffer[chip::QRCodeBasicSetupPayloadGenerator::kMaxQRCodeBase38RepresentationLength + 1];
#ifdef DISPLAY_ENABLED
Timer mIconTimer;
LcdIcon mIcon = LcdIcon::None;
Expand Down
18 changes: 14 additions & 4 deletions examples/window-app/silabs/src/WindowManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@ void WindowManager::UpdateLEDs()
#if CHIP_ENABLE_OPENTHREAD
if (mState.isThreadProvisioned && mState.isThreadEnabled)
#else
if (mState.isWiFiProvisioned && mState.isWiFiEnabled)
if (ConnectivityMgr().IsWiFiStationProvisioned() && ConnectivityMgr().IsWiFiStationEnabled())
#endif

{
Expand Down Expand Up @@ -724,7 +724,8 @@ void WindowManager::UpdateLCD()
#if CHIP_ENABLE_OPENTHREAD
if (mState.isThreadProvisioned)
#else
if (mState.isWiFiProvisioned)
// if (mState.isWiFiProvisioned)
if (ConnectivityMgr().IsWiFiStationProvisioned())
#endif // CHIP_ENABLE_OPENTHREAD
{
Cover & cover = GetCover();
Expand All @@ -738,13 +739,22 @@ void WindowManager::UpdateLCD()
Attributes::CurrentPositionTilt::Get(cover.mEndpoint, tilt);
chip::DeviceLayer::PlatformMgr().UnlockChipStack();

#ifdef DISPLAY_ENABLED
if (!tilt.IsNull() && !lift.IsNull())
{
LcdPainter::Paint(slLCD, type, lift.Value(), tilt.Value(), mIcon);
}
#endif
}
#ifdef QR_CODE_ENABLED
else
{
chip::MutableCharSpan qrCode(mQRCodeBuffer);
if (GetQRCode(qrCode, chip::RendezvousInformationFlags(chip::RendezvousInformationFlag::kBLE)) == CHIP_NO_ERROR)
{
slLCD.SetQRCode((uint8_t *) qrCode.data(), qrCode.size());
slLCD.ShowQRCode(true);
}
}
#endif // QR_CODE_ENABLED
#endif // DISPLAY_ENABLED
}

Expand Down

0 comments on commit e6b445a

Please sign in to comment.