threadx移植tickless,内核开关中断使用basepri,单片机进入sleep之后无法唤醒,不使用basepri一切正常。
BASEPRI配置:
[C] 纯文本查看 复制代码 TX_PORT_USE_BASEPRI
TX_PORT_BASEPRI=0x10
睡眠接口:
[C] 纯文本查看 复制代码 #define TX_LOW_POWER_TICKLESS
#define TX_LOW_POWER_USER_ENTER app_enter_lowpower()
/**
* @brief 进入低功耗
*
*/
void app_enter_lowpower(void)
{
HAL_PWR_EnterSLEEPMode(PWR_MAINREGULATOR_ON, PWR_SLEEPENTRY_WFI);
}
不知道大佬有没有遇到过。我看了一下源码,进入睡眠前是打开中断的呀,理论上和屏蔽中断无关的呀
[C] 纯文本查看 复制代码 VOID tx_low_power_enter(VOID)
{
...
TX_RESTORE
/* User code to enter low power mode. This allows the application to power down
peripherals and put the processor in sleep mode.
*/
#ifdef TX_LOW_POWER_USER_ENTER
TX_LOW_POWER_USER_ENTER;
#endif
/* If the low power code returns, this routine returns to the tx_thread_schedule loop. */
}
|