Hi,
Say there's OMAP-L138 running an app based on TI BIOS (5.41.10.36), with tasks and UART driver working with HWI dispatcher in FIFO mode. At some point user wants to switch to lower core frequency, maintaining same UART baudrate. The order to go lower is issued in a task. I would like to make the whole change as soon as possible (and quick).
Before I change clocks, baudarate divisor I need(?) to suspend transmission. I'm trying to detect in UART ISR that there's that order using semaphores, however it doesn't work as I expected.
This is a mockup:
void UART_Send()
{
SEM_pend(sem_uart, SYS_FOREVER);
}
void UART_Suspend()
{
SEM_pend(sem_uart, SYS_FOREVER);
}
void UART_TxReady_ISR() // FIFO buffer empty ISR
{
// here I want to give chance for UART_Suspend
SEM_post(sem_uart); // this doesn't increase count but rather wCount in some subfields
if(SEM_pend(sem_uart, 0)) // this fails
{
if(no_more_to_tx)
SEM_post(sem_uart);
else
{
UART_Tx();
}
}
return;
}
Have you got ideas how to make this work?