Skip to content

Commit

Permalink
using release interrupt for button 1
Browse files Browse the repository at this point in the history
  • Loading branch information
silabs-srishylam committed Aug 18, 2023
1 parent 8806df8 commit 809869d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,10 @@ void IRQ021_Handler(void)
RSI_NPSSGPIO_ClrIntr(NPSS_GPIO_0_INTR);
RSI_NPSSGPIO_ClrIntr(NPSS_GPIO_2_INTR);
// if the btn is not pressed setting the state to 1
if (RSI_NPSSGPIO_GetPin(NPSS_GPIO_2))
if (RSI_NPSSGPIO_GetPin(NPSS_GPIO_2) && (!btn1))
{
btn1 = 1;
sl_button_on_change(1, 0);
}
// geting the state of the gpio 2 pin and checking if the btn is already pressed or not
if (!RSI_NPSSGPIO_GetPin(NPSS_GPIO_2) && btn1)
Expand Down
9 changes: 0 additions & 9 deletions examples/window-app/silabs/src/WindowManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -742,15 +742,6 @@ void WindowManager::ButtonEventHandler(uint8_t button, uint8_t btnAction)
}

AppTask::GetAppTask().PostEvent(&event);

// Since there is no release interrupt for button1 posting release event after press event
#ifdef SIWX_917
if (button)
{
event = CreateNewEvent(AppEvent::kEventType_DownReleased);
AppTask::GetAppTask().PostEvent(&event);
}
#endif
}

void WindowManager::GeneralEventHandler(AppEvent * aEvent)
Expand Down

0 comments on commit 809869d

Please sign in to comment.