Hi,
An engineer left and I had to take care of his code. It is just a circular buffer of reading char from a serial port. He used ATM_incu and ATM_decu, but the "charcount" is zero all the time.
I assumed his code should work, I'm new to TI chip, what is the advantage of the ATM? Thanks
/*
* ======== CIRC_readChar ========
*
* Reads a character from the circular buffer.
*/
Char CIRC_generic_readChar(CIRC_Handle circ)
{
Char c;
/* read character and increment the character count */
...
ATM_decu(&circ->charCount);
return (c);
}
/*
* ======== CIRC_writeChar ========
*
* Writes a character into the circular buffer
*/
Void CIRC_generic_writeChar(CIRC_Handle circ, Char c)
{
/* write character and decrement the character count */
...
ATM_incu(&circ->charCount);
}
}