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

Thread: Build Issue Teensy 3.2: __AVR__ defined?

  1. #1

    Build Issue Teensy 3.2: __AVR__ defined?

    I got a bug report that seems to indicate that __AVR__ is defined for the Teensy 3.2 builds. This define is not guarded:

    Code:
    #ifdef __AVR__
      #define NEOGPS_PACKED_DATA
    #endif
    A build for the Due seems to work correctly. Is __AVR__ supposed to be defined? I guess I assumed that it was the indicator for the 8-bit family of processors. This post might be related.

    Cheers,
    /dev
    Last edited by /dev; 09-07-2016 at 02:20 PM. Reason: title is 3.2!

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    26,398
    I'm testing with Arduino 1.6.11 and Teensyduino 1.30, using this:

    Code:
    void setup() {
    }
    
    void loop() {
      Serial.print("define test: ");
    #ifdef __AVR__
      Serial.print("__AVR__ ");
    #endif
    #ifdef __arm__
      Serial.print("__arm__ ");
    #endif
      Serial.println();
      delay(100);
    }
    Here's what I see in the serial monitor when I upload to a Teensy 3.2.

    Click image for larger version. 

Name:	sc.png 
Views:	99 
Size:	20.3 KB 
ID:	8076

  3. #3
    Quote Originally Posted by PaulStoffregen View Post
    Here's what I see in the serial monitor when I upload to a Teensy 3.2.
    With a little more information, I determined it was an out-of-date header copy in the repo that did not have the guard.

    Thanks for checking,
    /dev

Posting Permissions

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