Dear TI:
目前使用CC1312的芯片来执行两个任务,
1是rfEasyLinkEchoRx例程中的射频功能,2是使用串口连接串口工具读写数据。
/* Initialize the attributes structure with default values */
pthread_attr_init(&attrs);
/* Set priority, detach state, and stack size attributes */
priParam.sched_priority = 1;
retc = pthread_attr_setschedparam(&attrs, &priParam);
retc |= pthread_attr_setdetachstate(&attrs, PTHREAD_CREATE_DETACHED);
retc |= pthread_attr_setstacksize(&attrs, THREADSTACKSIZE);
if (retc != 0) {
/* failed to set attributes */
while (1) {}
}
retc = pthread_create(&thread, &attrs, rfEasyLinkEchoRxFnx, NULL);
if (retc != 0) {
/* pthread_create() failed */
while (1) {}
}
/*
* Let's make the temperature thread a higher priority .
* Higher number means higher priority in TI-RTOS.
*/
priParam.sched_priority = 2;
retc = pthread_attr_setschedparam(&attrs, &priParam);
retc |= pthread_attr_setdetachstate(&attrs, PTHREAD_CREATE_DETACHED);
retc |= pthread_attr_setstacksize(&attrs, THREADSTACKSIZE);
if (retc != 0) {
/* failed to set priority */
while (1) {}
}
retc = pthread_create(&thread, &attrs, RS485Thread, NULL);
if (retc != 0) {
/* pthread_create() failed */
while (1) {}
}
这是初始化线程的代码。一直出现只执行一个线程的情况,会卡在射频的
while(1) {
// Wait to receive a packet
EasyLink_receiveAsync(echoRxDoneCb, 0);
/* Wait indefinitely for Rx */
Semaphore_pend(echoDoneSem, BIOS_WAIT_FOREVER);
if(bBlockTransmit == false)
{}
放大这块。
还有就是串口读写的时候
while(1)
{
memset(recv_buf, 0, MAX_BUF_SIZE);
uart_read(&recv_buf[0], &recv_len);
func_unpackage(&recv_buf[0], recv_len);
UART_control(uart,(UART_CMD_RESERVED + 2),NULL);//清除uart_read中的buffer
chargeBaudFun();
}
会第一次进去之后就没有卡在读取那块。
请问这种情况下该怎么考虑,单独测试各自功能都可以实现,放一起就有问题了。