return value from a register write
-
Hey all, I'm working with a Phillips LPC2129 chip using a Keil compiler. In viewing the example code supplied by Keil, I noticed that they returned an 'int' from a call to a function sending a char out a UART configured as ab RS232 port. To write to the UART the following is requiredL U1THR = . The problem I have is that in the sample code provided by Keil they return that value in the 'putchar' call and I have no clue how to determine the value of the return. Moreover the manner in which a byte is written to the UART is a register write, not a function call. For example: return( U1THR = ch ); where ch is the char to be sent. Regardless of what value ch = the return value is 'H' (0x48). I reckon my question lies in how to determine the return value of an assignment? -any got any input on this? --------------------------------------------- Help... I'm embedded and I can't get out! It's amazine how simeple life can be when one get's his head out of his ass...embly If they don't get the basic research and learning skills down then they'll end up having a very hard life (Either that or they'll become managers) - Micheal P Butler