Skip to content

#include or #error inside #if not working as expected #33

Closed
@NicoHood

Description

@NicoHood

Ref: #18
Used official Leonardo board

New issue, just try this sketch:

#include <Arduino.h>
#if !defined(USBCON)
#error
#endif

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}

I have the same error within libraries unless I include Arduino.h. Not sure if this is intended, not sure if Arduino.h Includes the register definitions but I think this should be passed by default since things like DDRB should always be accessible without arduino layer.

However its weird that you can inlcude Arduino.h and it works then. And eve more weird that this does NOT help in a simple sketch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions