Tool/software: TI-RTOS
Hi,
I am using two threads in my application.
One thread is for transmitting the data on UART1 as per the IO's.
Other thread is with the higher priority for receiving the data on UART2 from the external device and transmit it over the UART1.
and my code looks like:
void *Thread2(void *arg0)
{
while (1) {
UART_read(uart2, &input, 1);
UART_write(uart1, &input, 1);
}
}
void *Thread1(void *arg0)
{
while (1) {
switch(cond) // as per the switch position
{
UART_write(uart1, &input, 1);
}
}
}
Here if i operate IO's then Thread2 is not executing after that. I think, It is struck because uart1 is already open in other thread for write operation.
Can anyone explain how to make "UART_write" to work in both the threads?
I try to use semaphore but i didn't succeed. I placed "Semaphore_post" after uatr_write in thread2
and "Semaphore_pend" after switch condition in thread1.
Regards
Kalyan.
