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.

关于CC2640R2F pinshutdown 问题

Other Parts Discussed in Thread: CC2640R2F

您好,我在运行例程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);  //没有亮灯

  • /*!
     *  @brief  Put 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]  shutdownState    the device-specific shutdown state
     *
     *  @param[in]  shutdownTime    the 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);

    看下这里的说明

  • 谢谢回答,我测试下来,在设置时间内并没有自动执行周期时间,应该是不支持吧
  • 是这样设置的
    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);
    }
  • 刚试了下确实不能唤醒,CC2640r2f不支持此模式