While you didn't explicitly call a function in your interrupt routine,
the compiler did for the right shift of TXByte.

Making TXByte a signed int makes this go away. (The MSP430 doesn't have
a single instruction to do the unsigned right shift.) You don't need for
it to be unsigned because you don't care about those bits.

A minor nit:

Making TXByte and BitCnt volatile buys you nothing except slower code.

Their values can't change while the interrupt is being serviced so it
doesn't help there. They also can't change while you aren't looking in
put_char() because it waits for the timer to finish.

David W. Schultz
"Life without stock is barely worth living..." - Anthony Bourdain

Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Mspgcc-users mailing list

Reply via email to