diff --git a/examples/all-clusters-app/esp32/main/AppTask.cpp b/examples/all-clusters-app/esp32/main/AppTask.cpp index 40398696a44b1f..2111d7cb32df47 100644 --- a/examples/all-clusters-app/esp32/main/AppTask.cpp +++ b/examples/all-clusters-app/esp32/main/AppTask.cpp @@ -64,13 +64,12 @@ CHIP_ERROR AppTask::StartAppTask() void AppTask::TimerEventHandler(TimerHandle_t xTimer) { AppEvent event; - event.mType = AppEvent::kEventType_Timer; + event.mType = AppEvent::kEventType_Timer; event.mTimerEvent.mContext = (void *) xTimer; - event.mHandler = FunctionTimerEventHandler; + event.mHandler = FunctionTimerEventHandler; sAppTask.PostEvent(&event); } - void AppTask::FunctionTimerEventHandler(AppEvent * aEvent) { if (aEvent->mType != AppEvent::kEventType_Timer) @@ -81,17 +80,17 @@ void AppTask::FunctionTimerEventHandler(AppEvent * aEvent) // initiate factory reset if (sAppTask.mFunctionTimerActive && sAppTask.mFunction == kFunction_StartBleAdv) { - //ESP_LOGI(TAG, "Factory Reset Triggered. Release button within %ums to cancel.", FACTORY_RESET_CANCEL_WINDOW_TIMEOUT); + // ESP_LOGI(TAG, "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. sAppTask.StartTimer(FACTORY_RESET_CANCEL_WINDOW_TIMEOUT); sAppTask.mFunction = kFunction_FactoryReset; // Turn off all LEDs before starting blink to make sure blink is // co-ordinated. - //sStatusLED.Set(false); - //sLockLED.Set(false); - //sStatusLED.Blink(500); - //sLockLED.Blink(500); + // sStatusLED.Set(false); + // sLockLED.Set(false); + // sStatusLED.Blink(500); + // sLockLED.Blink(500); } else if (sAppTask.mFunctionTimerActive && sAppTask.mFunction == kFunction_FactoryReset) { @@ -143,7 +142,7 @@ void AppTask::ActionInitiated(BoltLockManager::Action_t aAction, int32_t aActor) { sAppTask.mSyncClusterToButtonAction = true; } - //sLockLED.Blink(50, 50); + // sLockLED.Blink(50, 50); } void AppTask::ActionCompleted(BoltLockManager::Action_t aAction) { @@ -153,16 +152,15 @@ void AppTask::ActionCompleted(BoltLockManager::Action_t aAction) if (aAction == BoltLockManager::LOCK_ACTION) { ESP_LOGI(TAG, "Lock Action has been completed"); - //sLockLED.Set(true); + // sLockLED.Set(true); } else if (aAction == BoltLockManager::UNLOCK_ACTION) { ESP_LOGI(TAG, "Unlock Action has been completed"); - //sLockLED.Set(false); + // sLockLED.Set(false); } } - CHIP_ERROR AppTask::Init() { /* Print chip information */ @@ -174,8 +172,8 @@ CHIP_ERROR AppTask::Init() ESP_LOGI(TAG, "%dMB %s flash\n", spi_flash_get_chip_size() / (1024 * 1024), (chip_info.features & CHIP_FEATURE_EMB_FLASH) ? "embedded" : "external"); - // Create FreeRTOS sw timer for Function Selection - sFunctionTimer = xTimerCreate("FnTmr", // Just a text name, not used by the RTOS kernel + // Create FreeRTOS sw timer for Function Selection + sFunctionTimer = xTimerCreate("FnTmr", // Just a text name, not used by the RTOS kernel 1, // == default timer period (mS) false, // no timer reload (==one-shot) (void *) this, // init timer id = app task obj context diff --git a/examples/all-clusters-app/esp32/main/include/AppTask.h b/examples/all-clusters-app/esp32/main/include/AppTask.h index d905e5e90b4186..8a72b2d47e5777 100644 --- a/examples/all-clusters-app/esp32/main/include/AppTask.h +++ b/examples/all-clusters-app/esp32/main/include/AppTask.h @@ -19,8 +19,8 @@ #pragma once #include -#include #include +#include // Application-defined error codes in the CHIP_ERROR space. #define APP_ERROR_EVENT_QUEUE_FAILED CHIP_APPLICATION_ERROR(0x01) diff --git a/examples/lock-app/esp32/main/AppTask.cpp b/examples/lock-app/esp32/main/AppTask.cpp index 05c2ef27350066..9014982eba5975 100644 --- a/examples/lock-app/esp32/main/AppTask.cpp +++ b/examples/lock-app/esp32/main/AppTask.cpp @@ -16,13 +16,13 @@ */ #include "AppTask.h" -#include -#include #include "Button.h" #include "LEDWidget.h" #include "esp_log.h" #include #include +#include +#include //#include #include #include @@ -61,7 +61,7 @@ StackType_t appStack[APP_TASK_STACK_SIZE / sizeof(StackType_t)]; using namespace ::chip::DeviceLayer; using namespace ::chip::System; -//using namespace ESP32DoorLock::LockInitParams; +// using namespace ESP32DoorLock::LockInitParams; AppTask AppTask::sAppTask; @@ -258,9 +258,9 @@ void AppTask::ButtonEventHandler(uint8_t btnIdx, uint8_t btnAction) void AppTask::TimerEventHandler(TimerHandle_t xTimer) { AppEvent event; - event.mType = AppEvent::kEventType_Timer; + event.mType = AppEvent::kEventType_Timer; event.mTimerEvent.mContext = (void *) xTimer; - event.mHandler = FunctionTimerEventHandler; + event.mHandler = FunctionTimerEventHandler; sAppTask.PostEvent(&event); } @@ -428,10 +428,10 @@ void AppTask::ActionCompleted(BoltLockManager::Action_t aAction) void AppTask::PostLockActionRequest(int32_t aActor, BoltLockManager::Action_t aAction) { AppEvent event; - event.mType = AppEvent::kEventType_Lock; + event.mType = AppEvent::kEventType_Lock; event.mLockEvent.mActor = aActor; event.mLockEvent.mAction = aAction; - event.mHandler = LockActionEventHandler; + event.mHandler = LockActionEventHandler; PostEvent(&event); } diff --git a/examples/lock-app/esp32/main/include/AppTask.h b/examples/lock-app/esp32/main/include/AppTask.h index 3dba306c50f0bd..7a1aad3e221800 100644 --- a/examples/lock-app/esp32/main/include/AppTask.h +++ b/examples/lock-app/esp32/main/include/AppTask.h @@ -37,7 +37,6 @@ #define APP_ERROR_STOP_TIMER_FAILED CHIP_APPLICATION_ERROR(0x06) #define APP_ERROR_ALLOCATION_FAILED CHIP_APPLICATION_ERROR(0x07) - class AppTask { diff --git a/examples/lock-app/esp32/main/include/Button.h b/examples/lock-app/esp32/main/include/Button.h index d7ea047d52132c..fc838f806a1061 100644 --- a/examples/lock-app/esp32/main/include/Button.h +++ b/examples/lock-app/esp32/main/include/Button.h @@ -17,10 +17,10 @@ #pragma once -#include -#include "driver/gpio.h" #include "AppTask.h" +#include "driver/gpio.h" #include "freertos/FreeRTOS.h" +#include class Button { diff --git a/examples/platform/esp32/lock/BoltLockManager.cpp b/examples/platform/esp32/lock/BoltLockManager.cpp index 9aecf05bb6e6d9..8506bcf12278e5 100644 --- a/examples/platform/esp32/lock/BoltLockManager.cpp +++ b/examples/platform/esp32/lock/BoltLockManager.cpp @@ -268,7 +268,7 @@ void BoltLockManager::TimerEventHandler(TimerHandle_t xTimer) // once sLockTimer expires. Post an event to apptask queue with the actual handler // so that the event can be handled in the context of the apptask. AppEvent event; - event.mType = AppEvent::kEventType_Timer; + event.mType = AppEvent::kEventType_Timer; event.mTimerEvent.mContext = lock; if (lock->mAutoLockTimerArmed) {