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

[Silabs] LCD init BaseApplication #38048

Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

#define APP_TASK_NAME "AQS"

#define BLE_DEV_NAME "SiLabs-Air-Quality-Sensor"
#define BLE_DEV_NAME "SL-" APP_TASK_NAME

// Time it takes in ms for the simulated actuator to move from one
// APP Logo, boolean only. must be 64x64
Expand Down
1 change: 0 additions & 1 deletion examples/air-quality-sensor-app/silabs/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ CHIP_ERROR AppTask::AppInit()
CHIP_ERROR err = CHIP_NO_ERROR;
chip::DeviceLayer::Silabs::GetPlatform().SetButtonsCb(AppTask::ButtonEventHandler);
#ifdef DISPLAY_ENABLED
GetLCD().Init((uint8_t *) "Air-Quality-Sensor");
GetLCD().SetCustomUI(AirQualitySensorUI::DrawUI);
#endif

Expand Down
2 changes: 1 addition & 1 deletion examples/chef/silabs/include/AppConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

// ---- Lighting Example App Config ----

#define APP_TASK_NAME "Lit"
#define APP_TASK_NAME "Chef"

// Time it takes in ms for the simulated actuator to move from one
// state to another.
Expand Down
4 changes: 2 additions & 2 deletions examples/dishwasher-app/silabs/include/AppTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ class AppTask : public BaseApplication
private:
static AppTask sAppTask;
/**
* @brief AppTask initialisation function
* @brief Override of BaseApplication::AppInit() virtual method, called by BaseApplication::Init()
*
* @return CHIP_ERROR
*/
CHIP_ERROR Init();
CHIP_ERROR AppInit() override;

/**
* @brief PB0 Button event processing function
Expand Down
13 changes: 1 addition & 12 deletions examples/dishwasher-app/silabs/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,22 +60,11 @@ static EnergyReportingTestEventTriggerHandler sEnergyReportingTestEventTriggerHa
static DeviceEnergyManagementTestEventTriggerHandler sDeviceEnergyManagementTestEventTriggerHandler;
#endif

CHIP_ERROR AppTask::Init()
CHIP_ERROR AppTask::AppInit()
{
CHIP_ERROR err = CHIP_NO_ERROR;
chip::DeviceLayer::Silabs::GetPlatform().SetButtonsCb(AppTask::ButtonEventHandler);

#ifdef DISPLAY_ENABLED
GetLCD().Init((uint8_t *) "Dishwasher-App");
#endif

err = BaseApplication::Init();
if (err != CHIP_NO_ERROR)
{
SILABS_LOG("BaseApplication::Init() failed");
appError(err);
}

PlatformMgr().LockChipStack();
err = DeviceEnergyManager::Instance().Init();
PlatformMgr().UnlockChipStack();
Expand Down
6 changes: 5 additions & 1 deletion examples/energy-management-app/silabs/include/AppConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@

// ---- EVSE Example App Config ----

#if SL_MATTER_CONFIG_ENABLE_EXAMPLE_EVSE_DEVICE
#define APP_TASK_NAME "EVSE"
#else
#define APP_TASK_NAME "W-Heater"
#endif

#define BLE_DEV_NAME "SiLabs-EVSE"
#define BLE_DEV_NAME "SL-" APP_TASK_NAME
9 changes: 0 additions & 9 deletions examples/energy-management-app/silabs/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,15 +181,6 @@ CHIP_ERROR AppTask::AppInit()
{
CHIP_ERROR err = CHIP_NO_ERROR;
chip::DeviceLayer::Silabs::GetPlatform().SetButtonsCb(AppTask::ButtonEventHandler);

#ifdef DISPLAY_ENABLED
#if SL_MATTER_CONFIG_ENABLE_EXAMPLE_EVSE_DEVICE
GetLCD().Init((uint8_t *) "energy-management-App (EVSE)");
#elif SL_CONFIG_ENABLE_EXAMPLE_WATER_HEATER_DEVICE
GetLCD().Init((uint8_t *) "energy-management-App (WaterHeater)");
#endif
#endif

ApplicationInit();

#ifdef SL_MATTER_TEST_EVENT_TRIGGER_ENABLED
Expand Down
4 changes: 2 additions & 2 deletions examples/light-switch-app/silabs/include/AppConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@

// ---- Lighting Example App Config ----

#define APP_TASK_NAME "Lit"
#define APP_TASK_NAME "Light-Sw"

#define BLE_DEV_NAME "SiLabs-Light-Switch"
#define BLE_DEV_NAME "SL-" APP_TASK_NAME

// Time it takes in ms for the simulated actuator to move from one
// state to another.
Expand Down
4 changes: 0 additions & 4 deletions examples/light-switch-app/silabs/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,6 @@ CHIP_ERROR AppTask::AppInit()
CHIP_ERROR err = CHIP_NO_ERROR;
chip::DeviceLayer::Silabs::GetPlatform().SetButtonsCb(AppTask::ButtonEventHandler);

#ifdef DISPLAY_ENABLED
GetLCD().Init((uint8_t *) "Light Switch");
#endif

err = LightSwitchMgr::GetInstance().Init(kLightSwitchEndpoint, kGenericSwitchEndpoint);
if (err != CHIP_NO_ERROR)
{
Expand Down
4 changes: 2 additions & 2 deletions examples/lighting-app/silabs/include/AppConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@

// ---- Lighting Example App Config ----

#define APP_TASK_NAME "Lit"
#define APP_TASK_NAME "Light"

#define BLE_DEV_NAME "SiLabs-Light"
#define BLE_DEV_NAME "SL-" APP_TASK_NAME

// Time it takes in ms for the simulated actuator to move from one
// state to another.
Expand Down
4 changes: 0 additions & 4 deletions examples/lighting-app/silabs/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,6 @@ CHIP_ERROR AppTask::AppInit()
CHIP_ERROR err = CHIP_NO_ERROR;
chip::DeviceLayer::Silabs::GetPlatform().SetButtonsCb(AppTask::ButtonEventHandler);

#ifdef DISPLAY_ENABLED
GetLCD().Init((uint8_t *) "Lighting-App");
#endif

err = LightMgr().Init();
if (err != CHIP_NO_ERROR)
{
Expand Down
2 changes: 1 addition & 1 deletion examples/lit-icd-app/silabs/include/AppConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

#define APP_TASK_NAME "Lit"

#define BLE_DEV_NAME "SiLabs-LIT-ICD"
#define BLE_DEV_NAME "SL-" APP_TASK_NAME

// APP Logo, boolean only. must be 64x64
#define ON_DEMO_BITMAP \
Expand Down
5 changes: 0 additions & 5 deletions examples/lit-icd-app/silabs/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,6 @@ CHIP_ERROR AppTask::AppInit()
{
CHIP_ERROR err = CHIP_NO_ERROR;
chip::DeviceLayer::Silabs::GetPlatform().SetButtonsCb(AppTask::ButtonEventHandler);

#ifdef DISPLAY_ENABLED
GetLCD().Init((uint8_t *) "LIT ICD");
#endif

return err;
}

Expand Down
2 changes: 1 addition & 1 deletion examples/lock-app/silabs/include/AppConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

#define APP_TASK_NAME "Lock"

#define BLE_DEV_NAME "SiLabs-Door-Lock"
#define BLE_DEV_NAME "SL-" APP_TASK_NAME

// Time it takes in ms for the simulated actuator to move from one
// state to another.
Expand Down
4 changes: 0 additions & 4 deletions examples/lock-app/silabs/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,6 @@ CHIP_ERROR AppTask::AppInit()

chip::DeviceLayer::Silabs::GetPlatform().SetButtonsCb(AppTask::ButtonEventHandler);

#ifdef DISPLAY_ENABLED
GetLCD().Init((uint8_t *) "Lock-App", true);
#endif

#if defined(ENABLE_CHIP_SHELL)
err = RegisterLockEvents();
if (err != CHIP_NO_ERROR)
Expand Down
4 changes: 4 additions & 0 deletions examples/platform/silabs/BaseApplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,10 @@ CHIP_ERROR BaseApplication::BaseInit()
{
CHIP_ERROR err = CHIP_NO_ERROR;

#ifdef DISPLAY_ENABLED
GetLCD().Init((uint8_t *) APP_TASK_NAME);
#endif

#ifdef SL_WIFI
/*
* Wait for the WiFi to be initialized
Expand Down
4 changes: 2 additions & 2 deletions examples/pump-app/silabs/include/AppConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@

// ---- Lighting Example App Config ----

#define APP_TASK_NAME "Lit"
#define APP_TASK_NAME "Pump"

#define BLE_DEV_NAME "SiLabs-Pump"
#define BLE_DEV_NAME "SL-" APP_TASK_NAME

#define ON_DEMO_BITMAP \
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \
Expand Down
4 changes: 0 additions & 4 deletions examples/pump-app/silabs/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,6 @@ CHIP_ERROR AppTask::AppInit()
CHIP_ERROR err = CHIP_NO_ERROR;
chip::DeviceLayer::Silabs::GetPlatform().SetButtonsCb(AppTask::ButtonEventHandler);

#ifdef DISPLAY_ENABLED
GetLCD().Init((uint8_t *) "Pump-App");
#endif

err = PumpMgr().Init();
if (err != CHIP_NO_ERROR)
{
Expand Down
2 changes: 1 addition & 1 deletion examples/refrigerator-app/silabs/include/AppConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

#define APP_TASK_NAME "Refr"

#define BLE_DEV_NAME "SiLabs-Refrigerator"
#define BLE_DEV_NAME "SL-" APP_TASK_NAME

// Time it takes in ms for the simulated actuator to move from one
// state to another.
Expand Down
4 changes: 0 additions & 4 deletions examples/refrigerator-app/silabs/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,6 @@ CHIP_ERROR AppTask::AppInit()
CHIP_ERROR err = CHIP_NO_ERROR;
chip::DeviceLayer::Silabs::GetPlatform().SetButtonsCb(AppTask::ButtonEventHandler);

#ifdef DISPLAY_ENABLED
GetLCD().Init((uint8_t *) "Refrigrator-App");
#endif

err = RefrigeratorMgr().Init();
if (err != CHIP_NO_ERROR)
{
Expand Down
4 changes: 2 additions & 2 deletions examples/smoke-co-alarm-app/silabs/include/AppConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@

// ---- Smoke CO Alarm Example App Config ----

#define APP_TASK_NAME "Alm"
#define APP_TASK_NAME "Smoke"

#define BLE_DEV_NAME "SiLabs-Alarm"
#define BLE_DEV_NAME "SL-" APP_TASK_NAME

// Time it takes in ms for the simulated actuator to move from one
// state to another.
Expand Down
4 changes: 0 additions & 4 deletions examples/smoke-co-alarm-app/silabs/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ CHIP_ERROR AppTask::AppInit()
CHIP_ERROR err = CHIP_NO_ERROR;
chip::DeviceLayer::Silabs::GetPlatform().SetButtonsCb(AppTask::ButtonEventHandler);

#ifdef DISPLAY_ENABLED
GetLCD().Init((uint8_t *) "Smoke-CO-Alarm-App");
#endif

err = AlarmMgr().Init();
if (err != CHIP_NO_ERROR)
{
Expand Down
4 changes: 2 additions & 2 deletions examples/thermostat/silabs/include/AppConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@

// ---- Lighting Example App Config ----

#define APP_TASK_NAME "Lit"
#define APP_TASK_NAME "Therm"

#define BLE_DEV_NAME "SiLabs-Thermostat"
#define BLE_DEV_NAME "SL-" APP_TASK_NAME

// Time it takes in ms for the simulated actuator to move from one
// state to another.
Expand Down
1 change: 0 additions & 1 deletion examples/thermostat/silabs/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ CHIP_ERROR AppTask::AppInit()
chip::DeviceLayer::Silabs::GetPlatform().SetButtonsCb(AppTask::ButtonEventHandler);

#ifdef DISPLAY_ENABLED
GetLCD().Init((uint8_t *) "Thermostat-App");
GetLCD().SetCustomUI(ThermostatUI::DrawUI);
#endif

Expand Down
4 changes: 2 additions & 2 deletions examples/window-app/silabs/include/AppConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
#include "silabs_utils.h"

// ---- Window Example App Config ----
#define APP_TASK_NAME "APP"
#define APP_TASK_NAME "Window"
#define APP_EVENT_QUEUE_SIZE 20
#define BLE_DEV_NAME "SiLabs-Window"
#define BLE_DEV_NAME "SL-" APP_TASK_NAME

#define LCD_SIZE 128
#define LCD_MARGIN_SIZE 1
Expand Down
4 changes: 0 additions & 4 deletions examples/window-app/silabs/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@ CHIP_ERROR AppTask::AppInit()
CHIP_ERROR err = CHIP_NO_ERROR;
chip::DeviceLayer::Silabs::GetPlatform().SetButtonsCb(WindowManager::ButtonEventHandler);

#ifdef DISPLAY_ENABLED
GetLCD().Init((uint8_t *) "Window-App");
#endif

err = WindowManager::sWindow.Init();

if (err != CHIP_NO_ERROR)
Expand Down
Loading