Skip to content

Commit

Permalink
fix device not sleep issue
Browse files Browse the repository at this point in the history
  • Loading branch information
shih840426 committed Jan 9, 2024
1 parent 5386744 commit 8261246
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
4 changes: 0 additions & 4 deletions examples/platform/rt58x/FreeRTOSConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,7 @@ extern uint32_t SystemCoreClock;
#define configUSE_PREEMPTION (1)
#define configUSE_TIME_SLICING (0)
#define configUSE_PORT_OPTIMISED_TASK_SELECTION (0)
#if(CHIP_CONFIG_ENABLE_ICD_SERVER)
#define configUSE_TICKLESS_IDLE (1)
#else
#define configUSE_TICKLESS_IDLE (0)
#endif

#define configMAX_PRIORITIES (56)
#define configMINIMAL_STACK_SIZE (128) /* Number of words to use for Idle and Timer stacks */
Expand Down
2 changes: 2 additions & 0 deletions examples/platform/rt58x/matter_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ extern "C" void vApplicationIdleHook(void)

extern "C" void vPortSuppressTicksAndSleep(TickType_t xExpectedIdleTime_ms)
{
#if CHIP_CONFIG_ENABLE_ICD_SERVER
TickType_t xModifiableIdleTime;

__disable_irq();
Expand Down Expand Up @@ -125,4 +126,5 @@ extern "C" void vPortSuppressTicksAndSleep(TickType_t xExpectedIdleTime_ms)
__enable_irq();
}
}
#endif
}
16 changes: 8 additions & 8 deletions src/platform/RT58x/CHIPPlatformConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,20 +77,20 @@
#endif


// #ifndef CHIP_DEVICE_CONFIG_SED_IDLE_INTERVAL
// #define CHIP_DEVICE_CONFIG_SED_IDLE_INTERVAL chip::System::Clock::Milliseconds32(650)
// #endif
#ifndef CHIP_DEVICE_CONFIG_SED_IDLE_INTERVAL
#define CHIP_DEVICE_CONFIG_SED_IDLE_INTERVAL chip::System::Clock::Milliseconds32(1000)
#endif

// #ifndef CHIP_DEVICE_CONFIG_SED_ACTIVE_INTERVAL
// #define CHIP_DEVICE_CONFIG_SED_ACTIVE_INTERVAL chip::System::Clock::Milliseconds32(250)
// #endif
#ifndef CHIP_DEVICE_CONFIG_SED_ACTIVE_INTERVAL
#define CHIP_DEVICE_CONFIG_SED_ACTIVE_INTERVAL chip::System::Clock::Milliseconds32(200)
#endif

#ifndef CHIP_DEVICE_CONFIG_ICD_SLOW_POLL_INTERVAL
#define CHIP_DEVICE_CONFIG_ICD_SLOW_POLL_INTERVAL chip::System::Clock::Milliseconds32(1000)
#define CHIP_DEVICE_CONFIG_ICD_SLOW_POLL_INTERVAL CHIP_DEVICE_CONFIG_SED_IDLE_INTERVAL
#endif

#ifndef CHIP_DEVICE_CONFIG_ICD_FAST_POLL_INTERVAL
#define CHIP_DEVICE_CONFIG_ICD_FAST_POLL_INTERVAL chip::System::Clock::Milliseconds32(250)
#define CHIP_DEVICE_CONFIG_ICD_FAST_POLL_INTERVAL CHIP_DEVICE_CONFIG_SED_ACTIVE_INTERVAL
#endif

#ifndef CHIP_CONFIG_ICD_IDLE_MODE_INTERVAL_SEC
Expand Down

0 comments on commit 8261246

Please sign in to comment.