Skip to content

Commit

Permalink
Fix 917 buttons (#26355)
Browse files Browse the repository at this point in the history
  • Loading branch information
jepenven-silabs authored and pull[bot] committed Jun 22, 2023
1 parent 09f4928 commit 1096430
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion examples/lighting-app/silabs/SiWx917/include/AppTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class AppTask : public BaseApplication
* @param btnAction button action - SL_SIMPLE_BUTTON_PRESSED,
* SL_SIMPLE_BUTTON_RELEASED or SL_SIMPLE_BUTTON_DISABLED
*/
void ButtonEventHandler(uint8_t button, uint8_t btnAction);
static void ButtonEventHandler(uint8_t button, uint8_t btnAction);

/**
* @brief Callback called by the identify-server when an identify command is received
Expand Down
5 changes: 5 additions & 0 deletions examples/lighting-app/silabs/SiWx917/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@

#include <platform/CHIPDeviceLayer.h>

#include <platform/silabs/platformAbstraction/SilabsPlatform.h>

#include "LEDWidget.h"
#define APP_ACTION_LED 1

Expand Down Expand Up @@ -119,6 +121,9 @@ AppTask AppTask::sAppTask;
CHIP_ERROR AppTask::Init()
{
CHIP_ERROR err = CHIP_NO_ERROR;

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

#ifdef DISPLAY_ENABLED
GetLCD().Init((uint8_t *) "Lighting-App");
#endif
Expand Down
4 changes: 4 additions & 0 deletions examples/window-app/silabs/SiWx917/src/WindowAppImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ extern "C" void sl_button_on_change(uint8_t btn, uint8_t btnAction);
SilabsLCD slLCD;
#endif

#include <platform/silabs/platformAbstraction/SilabsPlatform.h>

#define APP_TASK_STACK_SIZE (4096)
#define APP_TASK_PRIORITY 2
#define APP_EVENT_QUEUE_SIZE 10
Expand Down Expand Up @@ -186,6 +188,8 @@ void WindowAppImpl::OnIconTimeout(WindowApp::Timer & timer)

CHIP_ERROR WindowAppImpl::Init()
{
chip::DeviceLayer::Silabs::GetPlatform().SetButtonsCb(WindowAppImpl::ButtonEventHandler);

WindowApp::Init();

// Initialize App Task
Expand Down

0 comments on commit 1096430

Please sign in to comment.