Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 2 of 2

Thread: Porting from AVR to Teensy 3.2

  1. #1
    Junior Member
    Join Date
    Oct 2016

    Porting from AVR to Teensy 3.2

    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.

  2. #2
    Senior Member
    Join Date
    Jan 2013
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts