您好,我在运行例程pinshutdown中,发现是 Power_shutdown(0, 0);查阅资料发现有两个参数可以更改,
int_fast16_t Power_shutdown(uint_fast16_t shutdownState,
uint_fast32_t shutdownTime);
请问shutdownTime这个参数,cc2640R2F支持吗?谢谢
我当时在例程添加了点灯,测试了这个,发现好像是不支持的:
#define SHUTDOWN_TIME 100000
…..
Power_shutdown(0, SHUTDOWN_TIME );
PIN_setOutputValue(hPins, Board_PIN_LED0, 1); //没有亮灯
Kevin Qiu1:
/*!*@briefPut the device into a shutdown state**This function will transition the device into a shutdown state.*Before the actual transition is initiated, notifications will be sent to*any clients who've registered (with Power_registerNotify()) for an*'entering shutdown' event.The event name is device specific, and defined*in the device-specific Power include file.For example, for CC32XX, the*event is "PowerCC32XX_ENTERING_SHUTDOWN", which is defined in*PowerCC32XX.h.Once notifications have been completed, the device shutdown*will commence.**If the device is successfully transitioned to shutdown, this function*call will never return.Upon wakeup, the device and application will*be rebooted (through a device reset).If the transition is not*successful, one of the error codes listed below will be returned.**On some devices a timed wakeup from shutdown can be specified, using*the shutdownTime parameter.This enables an autonomous application reboot*at a future time.For example, an application can go to shutdown, and then*automatically reboot at a future time to do some work. And once that work*is done, the application can shutdown again, for another timed interval.*The time interval is specified via the shutdownTime parameter. (On devices*that do not support this feature, any value specified for shutdownTime will*be ignored.)If the specified shutdownTime is zero, or otherwise less than*the total shutdown latency for the device, the shutdownTime parameter will*be ignored.The shutdown latency for the device can be found in the*device-specific Power include file.For example, for the CC32XX, this*latency is defined in PowerCC32XX.h, as "PowerCC32XX_TOTALTIMESHUTDOWN".)**@param[in]shutdownStatethe device-specific shutdown state**@param[in]shutdownTimethe amount of time (in milliseconds) to keep*the the device in the shutdown state; this parameter is not supported on*all device families.**@retval#Power_ECHANGE_NOT_ALLOWED if a constraint is prohibiting*shutdown.**@retval#Power_EFAIL if an error occurred during client notifications.**@retval#Power_EINVALIDINPUT if the shutdownState is invalid.**@retval#Power_EBUSY if another transition is already in progress.*/ int_fast16_t Power_shutdown(uint_fast16_t shutdownState,uint_fast32_t shutdownTime);看下这里的说明
user6172527:
回复 Kevin Qiu1:
谢谢回答,我测试下来,在设置时间内并没有自动执行周期时间,应该是不支持吧
user6172527:
回复 Kevin Qiu1:
是这样设置的
static void taskFxn(UArg a0, UArg a1)
{uint32_t sleepUs = 500000;Task_sleep(sleepUs / Clock_tickPeriod);PIN_setOutputValue(hPins, Board_PIN_LED1, 1);Task_sleep(sleepUs / Clock_tickPeriod);PIN_setOutputValue(hPins, Board_PIN_LED1, 0);Task_sleep(sleepUs / Clock_tickPeriod);PIN_setOutputValue(hPins, Board_PIN_LED1, 1);/* Turn off LED0 关闭LED0*/PIN_setOutputValue(hPins, Board_PIN_LED0, 0);
/* Go to shutdown 关机*/Power_shutdown(0, SHOUTDOWN_TIME);
/* Should never get here, since shutdown will reset. */while (1);
}