您好
我正在使用带有 simple_peripheral 示例(SDK_5_30_00_03)的 cc2640r2f launchpad、并希望休眠设备并每小时唤醒一次以降低能耗。 我搜索过、但找不到任何用于配置它的代码。
感谢您的帮助
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
ı 关闭所有驱动器和广告,但能源消耗从0.8 mA 增加到4 mA . 为什么? 无法唤醒设备。 这是我的密码:
if (events & SBP_PERIODIC_EVT)
{
if(mytimer<10)
{
SimplePeripheral_performPeriodicTask();
Set_Adv_Data();
}
Util_startClock(&periodicClock);
mytimer++;
if(mytimer>10)
{
UART_write(uart,"SLEEP\r\n",7);
ADCBuf_close(MyAdcBuf);
UART_close(uart);
NVS_close(nvsHandle);
I2C_close(i2c);
Watchdog_close(watchdogHandle);
uint8_t initialAdvertEnable = FALSE;
// Set the Peripheral GAPRole Parameters
GAPRole_SetParameter(GAPROLE_ADVERT_ENABLED, sizeof(uint8_t),
&initialAdvertEnable);
}else if(mytimer>40)
{
MyAdcBuf = ADCBuf_open(Board_ADCBUF0, &adcparams);
uart = UART_open(Board_UART0, &uartParams);
nvsHandle = NVS_open(Board_NVSINTERNAL, &nvsParams);
i2c = I2C_open(Board_I2C_TMP, &i2cParams);
Watchdog_close(watchdogHandle);
uint8_t initialAdvertEnable = TRUE;
// Set the Peripheral GAPRole Parameters
GAPRole_SetParameter(GAPROLE_ADVERT_ENABLED, sizeof(uint8_t),
&initialAdvertEnable);
UART_write(uart,"WAKEUP\r\n",8);
mytimer=0;
}
}您好!
ı 关闭所有驱动程序和广告,但能源消耗从0.8 mA 增加到4 mA。 为什么? 无法唤醒设备[/报价]听起来好像设备已崩溃... 尝试在代码中逐步找出问题。
另请注意、您使用 UART 的方式表明它配置为阻塞模式(与 BLEStack 配合使用时、不建议这样做)。
最后但同样重要的是、您似乎正在关闭两倍的看门狗。 可能需要仔细检查一下。
此致、