simpleBLEPeripheral 例程中增加UART调试程序跑飞。
我在调试CC2650,simpleBLEPeripheral 例程中增加UART调试程序跑飞。,UART已经在mian()中执行了初始化,在LED闪烁控制任务中调用 UART_write(SbpUartHandle, txbuf, 5); 就会程序跑飞。不知道什么原因?
下面是初始化:
static void Uart_init(void)
{
UART_Params params;
// Init UART and specify non-default parameters
UART_Params_init(¶ms);
params.baudRate = 115200;
params.writeDataMode = UART_DATA_BINARY;
params.readMode = UART_MODE_CALLBACK;
params.readDataMode = UART_DATA_BINARY;
params.readCallback = readCallback;
// Open the UART and do the read
uarthandle = UART_open(Board_UART, ¶ms); // Enable RETURN_PARTIAL
UART_control(uarthandle, 32, NULL); // UART_read()
UART_read(uarthandle, rxBuf, 100);
}
static void led_clockHandler(UArg arg)
{ // Store the event. events |= LED_PERIODIC_EVT;
// Wake up the application.
Semaphore_post(sem);
if(fg_led)
{
PIN_setOutputValue(ledPin,Board_LED3,1);
fg_led=0;
}
else
{
fg_led=1; PIN_setOutputValue(ledPin,Board_LED3,0);
}
UART_write(SbpUartHandle, txbuf, 5); UART_write(uarthandle, txBuf, 5);
}
可以通过链接下载http://processors.wiki.ti.com/index.php/SimpleBLEPeripheral_SerialInterface页面下方的 File:SimpleBLEPeripheral UART.zip - SimpleBLEPeripheral including SerialInterface (BLEv1.4.0)
我下载看了,CC2650的和CC2450 UART的驱动差别还是挺大的,不能直接参考。