From ba504e34396545b506cb69adf8aa062cb94815c7 Mon Sep 17 00:00:00 2001 From: Junior Martinez <67972863+jmartinez-silabs@users.noreply.github.com> Date: Wed, 29 Nov 2023 07:25:54 -0500 Subject: [PATCH] [Silabs]Fixes and cleanup for our window app (#30693) * Fix WindowApp Provision state check. Fix some button release logic. Add trace. Start some cleanup old elements * Reuse BaseApplication factory reset sequence. more cleanup * add option to link App led to baseApplication to sync leds animations. More cleanup of duplicated or unused stuff --- examples/platform/silabs/BaseApplication.cpp | 132 +++++++++--------- examples/platform/silabs/BaseApplication.h | 35 +++-- examples/window-app/silabs/include/AppEvent.h | 15 -- .../window-app/silabs/include/WindowManager.h | 29 +--- examples/window-app/silabs/src/AppTask.cpp | 31 +--- .../window-app/silabs/src/WindowManager.cpp | 94 +++---------- 6 files changed, 119 insertions(+), 217 deletions(-) diff --git a/examples/platform/silabs/BaseApplication.cpp b/examples/platform/silabs/BaseApplication.cpp index eefddb708ba3bf..c8a99b45ac1a5d 100644 --- a/examples/platform/silabs/BaseApplication.cpp +++ b/examples/platform/silabs/BaseApplication.cpp @@ -27,10 +27,6 @@ #include -#if (defined(ENABLE_WSTK_LEDS) && (defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT) || defined(SIWX_917))) -#include "LEDWidget.h" -#endif // ENABLE_WSTK_LEDS - #ifdef DISPLAY_ENABLED #include "lcd.h" #ifdef QR_CODE_ENABLED @@ -129,9 +125,6 @@ StaticQueue_t sAppEventQueueStruct; StackType_t appStack[APP_TASK_STACK_SIZE / sizeof(StackType_t)]; StaticTask_t appTaskStruct; -BaseApplication::Function_t mFunction; -bool mFunctionTimerActive; - #ifdef DISPLAY_ENABLED SilabsLCD slLCD; #endif @@ -149,7 +142,10 @@ Identify gIdentify = { #endif // EMBER_AF_PLUGIN_IDENTIFY_SERVER } // namespace -bool BaseApplication::sIsProvisioned = false; + +bool BaseApplication::sIsProvisioned = false; +bool BaseApplication::sIsFactoryResetTriggered = false; +LEDWidget * BaseApplication::sAppActionLed = nullptr; #ifdef DIC_ENABLE namespace { @@ -280,39 +276,16 @@ void BaseApplication::FunctionTimerEventHandler(TimerHandle_t xTimer) void BaseApplication::FunctionEventHandler(AppEvent * aEvent) { - if (aEvent->Type != AppEvent::kEventType_Timer) - { - return; - } - + VerifyOrReturn(aEvent->Type == AppEvent::kEventType_Timer); // If we reached here, the button was held past FACTORY_RESET_TRIGGER_TIMEOUT, - // initiate factory reset - if (mFunctionTimerActive && mFunction == kFunction_StartBleAdv) + if (!sIsFactoryResetTriggered) { - SILABS_LOG("Factory Reset Triggered. Release button within %ums to cancel.", FACTORY_RESET_CANCEL_WINDOW_TIMEOUT); - - // Start timer for FACTORY_RESET_CANCEL_WINDOW_TIMEOUT to allow user to - // cancel, if required. - StartFunctionTimer(FACTORY_RESET_CANCEL_WINDOW_TIMEOUT); - -#if CHIP_CONFIG_ENABLE_ICD_SERVER == 1 - StartStatusLEDTimer(); -#endif // CHIP_CONFIG_ENABLE_ICD_SERVER - - mFunction = kFunction_FactoryReset; - -#if (defined(ENABLE_WSTK_LEDS) && (defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT) || defined(SIWX_917))) - // Turn off all LEDs before starting blink to make sure blink is - // co-ordinated. - sStatusLED.Set(false); - sStatusLED.Blink(500); -#endif // ENABLE_WSTK_LEDS + StartFactoryResetSequence(); } - else if (mFunctionTimerActive && mFunction == kFunction_FactoryReset) + else { - // Actually trigger Factory Reset - mFunction = kFunction_NoneSelected; - + // The factory reset sequence was in motion. The cancellation window expired. + // Factory Reset the device now. #if CHIP_CONFIG_ENABLE_ICD_SERVER == 1 StopStatusLEDTimer(); #endif // CHIP_CONFIG_ENABLE_ICD_SERVER @@ -436,7 +409,8 @@ void BaseApplication::LightEventHandler() #endif // CHIP_CONFIG_ENABLE_ICD_SERVER -#if (defined(ENABLE_WSTK_LEDS) && (defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT) || defined(SIWX_917))) +#if defined(ENABLE_WSTK_LEDS) +#if (defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT) || defined(SIWX_917)) // Update the status LED if factory reset has not been initiated. // // If system has "full connectivity", keep the LED On constantly. @@ -449,13 +423,18 @@ void BaseApplication::LightEventHandler() // the LEDs at an even rate of 100ms. // // Otherwise, blink the LED ON for a very short time. - if (mFunction != kFunction_FactoryReset) + if (!sIsFactoryResetTriggered) { ActivateStatusLedPatterns(); } sStatusLED.Animate(); -#endif // ENABLE_WSTK_LEDS && SL_CATALOG_SIMPLE_LED_LED1_PRESENT +#endif // SL_CATALOG_SIMPLE_LED_LED1_PRESENT + if (sAppActionLed) + { + sAppActionLed->Animate(); + } +#endif // ENABLE_WSTK_LEDS } void BaseApplication::ButtonHandler(AppEvent * aEvent) @@ -469,20 +448,22 @@ void BaseApplication::ButtonHandler(AppEvent * aEvent) // start blinking within the FACTORY_RESET_CANCEL_WINDOW_TIMEOUT if (aEvent->ButtonEvent.Action == static_cast(SilabsPlatform::ButtonAction::ButtonPressed)) { - if (!mFunctionTimerActive && mFunction == kFunction_NoneSelected) - { - StartFunctionTimer(FACTORY_RESET_TRIGGER_TIMEOUT); - mFunction = kFunction_StartBleAdv; - } + StartFunctionTimer(FACTORY_RESET_TRIGGER_TIMEOUT); } else { - // If the button was released before factory reset got initiated, open the commissioning window and start BLE advertissement - // in fast mode - if (mFunctionTimerActive && mFunction == kFunction_StartBleAdv) + if (sIsFactoryResetTriggered) { + CancelFactoryResetSequence(); + } + else + { + // The factory reset sequence was not initiated, + // Press and Release: + // - Open the commissioning window and start BLE advertissement in fast mode when not commissioned + // - Output qr code in logs + // - Cycle LCD screen CancelFunctionTimer(); - mFunction = kFunction_NoneSelected; OutputQrCode(false); #ifdef DISPLAY_ENABLED @@ -515,19 +496,6 @@ void BaseApplication::ButtonHandler(AppEvent * aEvent) #endif // CHIP_CONFIG_ENABLE_ICD_SERVER } } - else if (mFunctionTimerActive && mFunction == kFunction_FactoryReset) - { - CancelFunctionTimer(); - -#if CHIP_CONFIG_ENABLE_ICD_SERVER == 1 - StopStatusLEDTimer(); -#endif - - // Change the function to none selected since factory reset has been - // canceled. - mFunction = kFunction_NoneSelected; - SILABS_LOG("Factory Reset has been Canceled"); - } } } @@ -538,8 +506,6 @@ void BaseApplication::CancelFunctionTimer() SILABS_LOG("app timer stop() failed"); appError(APP_ERROR_STOP_TIMER_FAILED); } - - mFunctionTimerActive = false; } void BaseApplication::StartFunctionTimer(uint32_t aTimeoutInMs) @@ -558,8 +524,42 @@ void BaseApplication::StartFunctionTimer(uint32_t aTimeoutInMs) SILABS_LOG("app timer start() failed"); appError(APP_ERROR_START_TIMER_FAILED); } +} + +void BaseApplication::StartFactoryResetSequence() +{ + // Initiate the factory reset sequence + SILABS_LOG("Factory Reset Triggered. Release button within %ums to cancel.", FACTORY_RESET_CANCEL_WINDOW_TIMEOUT); + + // Start timer for FACTORY_RESET_CANCEL_WINDOW_TIMEOUT to allow user to + // cancel, if required. + StartFunctionTimer(FACTORY_RESET_CANCEL_WINDOW_TIMEOUT); - mFunctionTimerActive = true; + sIsFactoryResetTriggered = true; +#if CHIP_CONFIG_ENABLE_ICD_SERVER == 1 + StartStatusLEDTimer(); +#endif // CHIP_CONFIG_ENABLE_ICD_SERVER + +#if (defined(ENABLE_WSTK_LEDS) && (defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT) || defined(SIWX_917))) + // Turn off all LEDs before starting blink to make sure blink is + // co-ordinated. + sStatusLED.Set(false); + sStatusLED.Blink(500); +#endif // ENABLE_WSTK_LEDS +} + +void BaseApplication::CancelFactoryResetSequence() +{ + CancelFunctionTimer(); + +#if CHIP_CONFIG_ENABLE_ICD_SERVER == 1 + StopStatusLEDTimer(); +#endif + if (sIsFactoryResetTriggered) + { + sIsFactoryResetTriggered = false; + SILABS_LOG("Factory Reset has been Canceled"); + } } void BaseApplication::StartStatusLEDTimer() @@ -754,7 +754,7 @@ void BaseApplication::OutputQrCode(bool refreshLCD) } } -bool BaseApplication::getWifiProvisionStatus() +bool BaseApplication::GetProvisionStatus() { return BaseApplication::sIsProvisioned; } diff --git a/examples/platform/silabs/BaseApplication.h b/examples/platform/silabs/BaseApplication.h index 8bf67836b9c47a..7b31f233d920a4 100644 --- a/examples/platform/silabs/BaseApplication.h +++ b/examples/platform/silabs/BaseApplication.h @@ -36,6 +36,10 @@ #include #include +#if defined(ENABLE_WSTK_LEDS) +#include "LEDWidget.h" +#endif // ENABLE_WSTK_LEDS + #ifdef EMBER_AF_PLUGIN_IDENTIFY_SERVER #include #endif @@ -71,6 +75,8 @@ class BaseApplication BaseApplication() = default; virtual ~BaseApplication(){}; static bool sIsProvisioned; + static bool sIsFactoryResetTriggered; + static LEDWidget * sAppActionLed; /** * @brief Create AppTask task and Event Queue @@ -80,6 +86,20 @@ class BaseApplication */ CHIP_ERROR StartAppTask(TaskFunction_t taskFunction); + /** + * @brief Links the application specific led to the baseApplication context + * in order to synchronize both LED animations. + * Some apps may not have an application led or no animation patterns. + * + * @param appLed Pointer to the configure LEDWidget for the application defined LED + */ + void LinkAppLed(LEDWidget * appLed) { sAppActionLed = appLed; } + + /** + * @brief Remove the app Led linkage form the baseApplication context + */ + void UnlinkAppLed() { sAppActionLed = nullptr; } + /** * @brief PostEvent function that add event to AppTask queue for processing * @@ -104,7 +124,10 @@ class BaseApplication * Turns off Status LED before stopping timer */ static void StopStatusLEDTimer(void); - static bool getWifiProvisionStatus(void); + static bool GetProvisionStatus(void); + + static void StartFactoryResetSequence(void); + static void CancelFactoryResetSequence(void); #ifdef EMBER_AF_PLUGIN_IDENTIFY_SERVER // Idenfiy server command callbacks. @@ -114,16 +137,6 @@ class BaseApplication static void OnTriggerIdentifyEffect(Identify * identify); #endif - enum Function_t - { - kFunction_NoneSelected = 0, - kFunction_SoftwareUpdate = 0, - kFunction_StartBleAdv = 1, - kFunction_FactoryReset = 2, - - kFunction_Invalid - } Function; - protected: CHIP_ERROR Init(); diff --git a/examples/window-app/silabs/include/AppEvent.h b/examples/window-app/silabs/include/AppEvent.h index 6ed767d099b9b7..f343a105e10919 100644 --- a/examples/window-app/silabs/include/AppEvent.h +++ b/examples/window-app/silabs/include/AppEvent.h @@ -32,14 +32,6 @@ struct AppEvent { kEventType_Button = 0, kEventType_Timer, - kEventType_Light, - kEventType_Install, - kEventType_ButtonDown, - kEventType_ButtonUp, - - kEventType_None, - kEventType_Reset, - kEventType_ResetPressed, kEventType_ResetWarning, kEventType_ResetCanceled, // Button events @@ -54,13 +46,6 @@ struct AppEvent // Cover Attribute update events kEventType_AttributeChange, - - // Provisioning events - kEventType_ProvisionedStateChanged, - kEventType_ConnectivityStateChanged, - kEventType_BLEConnectionsChanged, - kEventType_WinkOff, - kEventType_WinkOn, }; uint16_t Type; diff --git a/examples/window-app/silabs/include/WindowManager.h b/examples/window-app/silabs/include/WindowManager.h index 33121118c7b60c..bed448d5895c61 100644 --- a/examples/window-app/silabs/include/WindowManager.h +++ b/examples/window-app/silabs/include/WindowManager.h @@ -116,7 +116,7 @@ class WindowManager void PostAttributeChange(chip::EndpointId endpoint, chip::AttributeId attributeId); static void ButtonEventHandler(uint8_t button, uint8_t btnAction); - void UpdateLEDs(); + void UpdateLED(); void UpdateLCD(); static void GeneralEventHandler(AppEvent * aEvent); @@ -124,32 +124,18 @@ class WindowManager static void OnIconTimeout(WindowManager::Timer & timer); protected: - struct StateFlags - { -#if CHIP_ENABLE_OPENTHREAD - bool isThreadProvisioned = false; - bool isThreadEnabled = false; -#else - bool isWiFiProvisioned = false; - bool isWiFiEnabled = false; -#endif - bool haveBLEConnections = false; - bool isWinking = false; - }; - Cover & GetCover(); Cover * GetCover(chip::EndpointId endpoint); static void OnLongPressTimeout(Timer & timer); Timer * mLongPressTimer = nullptr; - StateFlags mState; - bool mTiltMode = false; - bool mUpPressed = false; - bool mDownPressed = false; - bool mUpSuppressed = false; - bool mDownSuppressed = false; - bool mResetWarning = false; + bool mTiltMode = false; + bool mUpPressed = false; + bool mDownPressed = false; + bool mUpSuppressed = false; + bool mDownSuppressed = false; + bool mResetWarning = false; private: void HandleLongPress(); @@ -158,7 +144,6 @@ class WindowManager Cover mCoverList[WINDOW_COVER_COUNT]; uint8_t mCurrentCover = 0; - LEDWidget mStatusLED; LEDWidget mActionLED; #ifdef DISPLAY_ENABLED Timer mIconTimer; diff --git a/examples/window-app/silabs/src/AppTask.cpp b/examples/window-app/silabs/src/AppTask.cpp index 92c80531080acb..e8b5cc332bfc2f 100644 --- a/examples/window-app/silabs/src/AppTask.cpp +++ b/examples/window-app/silabs/src/AppTask.cpp @@ -23,8 +23,6 @@ #include "WindowManager.h" -#include "LEDWidget.h" - #include #include #include @@ -39,20 +37,10 @@ #include -#if !defined(BRD2704A) -#define LIGHT_LED 1 -#else -#define LIGHT_LED 0 -#endif - using namespace chip; using namespace ::chip::DeviceLayer; using namespace ::chip::DeviceLayer::Silabs; -namespace { -LEDWidget sLightLED; -} - using namespace chip::TLV; using namespace ::chip::DeviceLayer; @@ -82,23 +70,6 @@ CHIP_ERROR AppTask::Init() appError(err); } - sLightLED.Init(LIGHT_LED); - -// Update the LCD with the Stored value. Show QR Code if not provisioned -#ifdef DISPLAY_ENABLED - -#ifdef QR_CODE_ENABLED -#ifdef SL_WIFI - if (!ConnectivityMgr().IsWiFiStationProvisioned()) -#else - if (!ConnectivityMgr().IsThreadProvisioned()) -#endif /* !SL_WIFI */ - { - GetLCD().ShowQRCode(true); - } -#endif // QR_CODE_ENABLED -#endif - return err; } @@ -126,7 +97,7 @@ void AppTask::AppTaskMain(void * pvParameter) SILABS_LOG("App Task started"); - WindowManager::sWindow.UpdateLEDs(); + WindowManager::sWindow.UpdateLED(); WindowManager::sWindow.UpdateLCD(); while (true) diff --git a/examples/window-app/silabs/src/WindowManager.cpp b/examples/window-app/silabs/src/WindowManager.cpp index 46e883abe37dbc..309fb393565990 100644 --- a/examples/window-app/silabs/src/WindowManager.cpp +++ b/examples/window-app/silabs/src/WindowManager.cpp @@ -42,7 +42,6 @@ #ifdef DISPLAY_ENABLED #include -SilabsLCD slLCD; #endif #include @@ -53,7 +52,6 @@ using namespace chip::app::Clusters::WindowCovering; using namespace chip; using namespace ::chip::DeviceLayer; using namespace ::chip::DeviceLayer::Silabs; -#define APP_STATE_LED 0 #define APP_ACTION_LED 1 #ifdef DIC_ENABLE @@ -78,12 +76,6 @@ AppEvent CreateNewEvent(AppEvent::AppEventTypes type) return aEvent; } -inline void OnTriggerEffectCompleted(chip::System::Layer * systemLayer, void * appState) -{ - AppEvent event = CreateNewEvent(AppEvent::kEventType_WinkOff); - AppTask::GetAppTask().PostEvent(&event); -} - void WindowManager::Timer::Start() { if (xTimerIsTimerActive(mHandler)) @@ -156,7 +148,7 @@ void WindowManager::DispatchEventAttributeChange(chip::EndpointId endpoint, chip opStatus = OperationalStatusGet(endpoint); OperationalStatusPrint(opStatus); chip::DeviceLayer::PlatformMgr().UnlockChipStack(); - UpdateLEDs(); + UpdateLED(); break; /* RW Mode */ case Attributes::Mode::Id: @@ -183,7 +175,7 @@ void WindowManager::DispatchEventAttributeChange(chip::EndpointId endpoint, chip /* ============= Positions for Position Aware ============= */ case Attributes::CurrentPositionLiftPercent100ths::Id: case Attributes::CurrentPositionTiltPercent100ths::Id: - UpdateLEDs(); + UpdateLED(); UpdateLCD(); break; default: @@ -206,17 +198,12 @@ void WindowManager::HandleLongPress() mCurrentCover = mCurrentCover < WINDOW_COVER_COUNT - 1 ? mCurrentCover + 1 : 0; event.Type = AppEvent::kEventType_CoverChange; AppTask::GetAppTask().PostEvent(&event); + ChipLogDetail(AppServer, "App controls set to cover %d", mCurrentCover + 1); } else if (mUpPressed) { mUpSuppressed = true; - if (mResetWarning) - { - // Double long press button up: Reset now, you were warned! - event.Type = AppEvent::kEventType_Reset; - AppTask::GetAppTask().PostEvent(&event); - } - else + if (!mResetWarning) { // Long press button up: Reset warning! event.Type = AppEvent::kEventType_ResetWarning; @@ -229,6 +216,7 @@ void WindowManager::HandleLongPress() mDownSuppressed = true; Type type = GetCover().CycleType(); mTiltMode = mTiltMode && (Type::kTiltBlindLiftAndTilt == type); + ChipLogDetail(AppServer, "Cover type changed to %d", to_underlying(type)); } } @@ -613,8 +601,6 @@ CHIP_ERROR WindowManager::Init() { chip::DeviceLayer::PlatformMgr().LockChipStack(); - ConfigurationMgr().LogDeviceConfig(); - // Timers mLongPressTimer = new Timer(LONG_PRESS_TIMEOUT, OnLongPressTimeout, this); @@ -624,12 +610,8 @@ CHIP_ERROR WindowManager::Init() // Initialize LEDs LEDWidget::InitGpio(); - mStatusLED.Init(APP_STATE_LED); mActionLED.Init(APP_ACTION_LED); - -#ifdef DISPLAY_ENABLED - slLCD.Init(); -#endif + AppTask::GetAppTask().LinkAppLed(&mActionLED); chip::DeviceLayer::PlatformMgr().UnlockChipStack(); @@ -644,14 +626,11 @@ void WindowManager::PostAttributeChange(chip::EndpointId endpoint, chip::Attribu AppTask::GetAppTask().PostEvent(&event); } -void WindowManager::UpdateLEDs() +void WindowManager::UpdateLED() { Cover & cover = GetCover(); if (mResetWarning) { - mStatusLED.Set(false); - mStatusLED.Blink(500); - mActionLED.Set(false); mActionLED.Blink(500); } @@ -673,22 +652,18 @@ void WindowManager::UpdateLEDs() if (OperationalState::Stall != cover.mLiftOpState) { - mActionLED.Blink(100); } else if (LimitStatus::IsUpOrOpen == liftLimit) { - mActionLED.Set(true); } else if (LimitStatus::IsDownOrClose == liftLimit) { - mActionLED.Set(false); } else { - mActionLED.Blink(1000); } } @@ -698,11 +673,7 @@ void WindowManager::UpdateLCD() { // Update LCD #ifdef DISPLAY_ENABLED -#if CHIP_ENABLE_OPENTHREAD - if (mState.isThreadProvisioned) -#else - if (BaseApplication::getWifiProvisionStatus()) -#endif // CHIP_ENABLE_OPENTHREAD + if (BaseApplication::GetProvisionStatus()) { Cover & cover = GetCover(); chip::app::DataModel::Nullable lift; @@ -717,7 +688,7 @@ void WindowManager::UpdateLCD() if (!tilt.IsNull() && !lift.IsNull()) { - LcdPainter::Paint(slLCD, type, lift.Value(), tilt.Value(), mIcon); + LcdPainter::Paint(AppTask::GetAppTask().GetLCD(), type, lift.Value(), tilt.Value(), mIcon); } } #endif // DISPLAY_ENABLED @@ -748,24 +719,14 @@ void WindowManager::GeneralEventHandler(AppEvent * aEvent) { case AppEvent::kEventType_ResetWarning: window->mResetWarning = true; - if (window->mLongPressTimer) - { - window->mLongPressTimer->Start(); - } - SILABS_LOG("Factory Reset Triggered. Release button within %ums to cancel.", LONG_PRESS_TIMEOUT); - // Turn off all LEDs before starting blink to make sure blink is - // co-ordinated. - window->UpdateLEDs(); + AppTask::GetAppTask().StartFactoryResetSequence(); + window->UpdateLED(); break; case AppEvent::kEventType_ResetCanceled: window->mResetWarning = false; - SILABS_LOG("Factory Reset has been Canceled"); - window->UpdateLEDs(); - break; - - case AppEvent::kEventType_Reset: - chip::Server::GetInstance().ScheduleFactoryReset(); + AppTask::GetAppTask().CancelFactoryResetSequence(); + window->UpdateLED(); break; case AppEvent::kEventType_UpPressed: @@ -793,9 +754,9 @@ void WindowManager::GeneralEventHandler(AppEvent * aEvent) } else if (window->mDownPressed) { - window->mTiltMode = !(window->mTiltMode); - window->mUpSuppressed = window->mDownSuppressed = true; - aEvent->Type = AppEvent::kEventType_TiltModeChange; + window->mTiltMode = !(window->mTiltMode); + window->mDownSuppressed = true; + aEvent->Type = AppEvent::kEventType_TiltModeChange; AppTask::GetAppTask().PostEvent(aEvent); } else @@ -830,34 +791,20 @@ void WindowManager::GeneralEventHandler(AppEvent * aEvent) else if (window->mUpPressed) { window->mTiltMode = !(window->mTiltMode); - window->mUpSuppressed = window->mDownSuppressed = true; - aEvent->Type = AppEvent::kEventType_TiltModeChange; + window->mUpSuppressed = true; + aEvent->Type = AppEvent::kEventType_TiltModeChange; + AppTask::GetAppTask().PostEvent(aEvent); } else { window->GetCover().UpdateTargetPosition(OperationalState::MovingDownOrClose, window->mTiltMode); } break; + case AppEvent::kEventType_AttributeChange: window->DispatchEventAttributeChange(aEvent->mEndpoint, aEvent->mAttributeId); break; - case AppEvent::kEventType_ProvisionedStateChanged: - window->UpdateLEDs(); - window->UpdateLCD(); - break; - - case AppEvent::kEventType_WinkOn: - case AppEvent::kEventType_WinkOff: - window->mState.isWinking = (AppEvent::kEventType_WinkOn == aEvent->Type); - window->UpdateLEDs(); - break; - - case AppEvent::kEventType_ConnectivityStateChanged: - case AppEvent::kEventType_BLEConnectionsChanged: - window->UpdateLEDs(); - break; - #ifdef DISPLAY_ENABLED case AppEvent::kEventType_CoverTypeChange: window->UpdateLCD(); @@ -868,6 +815,7 @@ void WindowManager::GeneralEventHandler(AppEvent * aEvent) window->UpdateLCD(); break; case AppEvent::kEventType_TiltModeChange: + ChipLogDetail(AppServer, "App control mode changed to %s", window->mTiltMode ? "Tilt" : "Lift"); window->mIconTimer.Start(); window->mIcon = window->mTiltMode ? LcdIcon::Tilt : LcdIcon::Lift; window->UpdateLCD();