Porting from AVR to Teensy 3.2

Status
Not open for further replies.

josto

Member
For those who are looking for such errors:

I'm going to port a project from Mega2560 to Teensy 3.2. I had two stumbling blocks, which gave me long nights:
1. On the AVR processor, all pins are set to INPUT after reset. This is not the case with Teensy 3.2. For example, the external interrupts did not work.
2. The automatic cast of char variables (signed char) to int works with the AVR compiler as expected, (char) -1 becomes (int) -1), at teensy (char) -1 becomes (int)254.
 
Signedness of 'char' isn't specified in the C / C++ standards. On ARM, 'char' is usually unsigned. If you want a signed char, you must use 'signed char'.

(char) -1 is actually 255.
 
Status
Not open for further replies.
Back
Top