主题中讨论的其他部件:ENERGYTRACE
工具/软件:
您好、
我使用 CC1314 定制板。 我想使用待机模式以便在 UART 上没有活动时降低功耗。
我的应用使用 FreeRTOS。 我想回答以下问题
1.我可以 手动使用 Power_sleep (PowerCC26XX_STANDBY) 吗
2. 在进入内部待机模式之前,我是否需要暂停任务
3.将设备置于待机模式的步骤是什么?
4.我已经尝试过,但设备没有进入待机模式
static void EnterStandbyMode(void)
{
trx_off(); // close RF
CloseUart();//closeUART
StopTimer();//stop timer
TaskDelay(pdMS_TO_TICKS(1000)); // Let system settle
closeWatchdogTimer();
/* Configure the UART Rx pin as GPIO pin as input with falling-edge interrupt*/
GPIO_setConfig(CONFIG_GPIO_UART2_1_RX, GPIO_CFG_IN_PU | GPIO_CFG_IN_INT_FALLING);
// Register the callback function
GPIO_setCallback(CONFIG_GPIO_UART2_1_RX, GpioWakeUpCallback);
// Enable GPIO interrupts
GPIO_enableInt(CONFIG_GPIO_UART2_1_RX);
printf("cc1314 is in entering into standby mode \r\n");
// Suspend the FreeRTOS scheduler
vTaskSuspendAll();
int retVal = Power_sleep(PowerCC26XX_STANDBY); // Manually enter standby
if(WakeupFlag)
{
// Resume the FreeRTOS scheduler after waking up
xTaskResumeAll();
OpenUart();
WakeupFlag = false;
printf("cc1314 is in Active mode \r\n");
}
}
void GpioWakeUpCallback(uint_least8_t index) {
// Set the wake-up flag
WakeupFlag = true;
printf("cc1314 is wake up from standby \r\n");
}