我现在是用的
UART_readCancel(stMVC_UART_Handle);
UART_writeCancel(stMVC_UART_Handle);
UART_close(stMVC_UART_Handle);
这三句话关闭串口,但是我测量功耗发现(在开启POWER_SAVING的前提下):
1.不启用uart,功耗为1uA左右,按键事件可以正常触发,唤醒
打开串口不关闭的时候是1.3mA,按键正常
调用上面三个函数后功耗反而上升到了3.7mA,按键无法触发
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.
我现在是用的
UART_readCancel(stMVC_UART_Handle);
UART_writeCancel(stMVC_UART_Handle);
UART_close(stMVC_UART_Handle);
这三句话关闭串口,但是我测量功耗发现(在开启POWER_SAVING的前提下):
1.不启用uart,功耗为1uA左右,按键事件可以正常触发,唤醒
打开串口不关闭的时候是1.3mA,按键正常
调用上面三个函数后功耗反而上升到了3.7mA,按键无法触发
注意下是否初始化了
/*!
* @brief Function to initialize a given UART peripheral
*
* Function to initialize a given UART peripheral specified by the
* particular index value.
*
* @pre UART_init() has been called
*
* @param index Logical peripheral number for the UART indexed into
* the UART_config table
*
* @param params Pointer to a parameter block. If NULL, default
* parameter values will be used. All the fields in
* this structure are RO (read-only).
*
* @return A #UART_Handle upon success. NULL if an error occurs, or if the
* indexed UART peripheral is already opened.
*
* @sa UART_init()
* @sa UART_close()
*/
extern UART_Handle UART_open(uint_least8_t index, UART_Params *params);
可否提供较完整程式码,关于uart open/close的程序,我测试10小时,都会死机
好不容易不死机了,终于底功耗了,但发现uart可能没有open 成功
感恩