连续签到天数:1天 | 签到总天数:22天 | 签到总奖励:222金币 |
|
马上注册,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册 
×
我是用的是ADK2.5.1,硬件是BC57E687C,我在source工程的基础上添加串口程序,在主函数中添加初始化函数uart_data_stream_init();。
int main(void)
{
/* turn off charger LED indications */
ChargerConfigure(CHARGER_SUPPRESS_LED0, TRUE);
/* initialise state machine */
states_set_state(SOURCE_STATE_INITIALISING);
uart_data_stream_init(); //串口初始化函数
MessageLoop();
return 0;
}
最后卡在初始化函数中的StreamUartSink()
void uart_data_stream_init(void)
{
/* Assign task message handler */
theUARTStreamTask.task.handler = UARTStreamMessageHandler;
/* Configure uart settings */
StreamUartConfigure(VM_UART_RATE_38K4, VM_UART_STOP_ONE, VM_UART_PARITY_NONE);
/* Get the sink for the uart */
theUARTStreamTask.uart_sink = StreamUartSink(); //就是该函数返回值一直为0
PanicNull(theUARTStreamTask.uart_sink); //所以这里提示错误。
/* Get the source for the uart */
theUARTStreamTask.uart_source = StreamUartSource();
PanicNull(theUARTStreamTask.uart_source);
/* Register uart source with task */
MessageSinkTask(StreamSinkFromSource(theUARTStreamTask.uart_source), &theUARTStreamTask.task);
}
另外,编译的时候没有错误,就是DEBUG运行时卡在那。我在SINK程序的基础上添加了这个串口程序,可以正常使用。难道source程序不能添加吗???求大神指点一下,谢谢!!!
|
|