mmarchetti / DirectIO

Fast, simple I/O library for Arduino
GNU Lesser General Public License v3.0
116 stars 27 forks source link

PlatformIO Compiler Error with direct_io_pin example #26

Closed jakespeed1311 closed 2 years ago

jakespeed1311 commented 4 years ago

Hello, i tried to test the Lib with Platformio and compile the Examble "direct_io_pin.ino" My version of PlatformIO ist 3.1.0 Core 4.2.1 I use an Arduino DUE an Programming Port tis ist Atmel SAM 4.1.0

'reinterpret_cast<Pio*>(1074662912)' is not a constant expression L redifiniton of that thing ? But i don't kow how do fix this. Thanks for help!

The error in the Terminal Output:

Executing task: C:\Users\admin.platformio\penv\Scripts\platformio.exe run <

Processing due (platform: atmelsam; board: due; framework: arduino)

Verbose mode can be enabled via -v, --verbose option CONFIGURATION: https://docs.platformio.org/page/boards/atmelsam/due.html PLATFORM: Atmel SAM 4.1.0 > Arduino Due (Programming Port) HARDWARE: AT91SAM3X8E 84MHz, 96KB RAM, 512KB Flash DEBUG: Current (atmel-ice) External (atmel-ice, blackmagic, jlink, stlink) PACKAGES:

mmarchetti commented 4 years ago

I haven't tested with PlatformIO. However, in the CMSIS header file (sam3x8e.h) there are two definitions of PIOA, depending on whether __ASSEMBLY__ is defined.

When targeting AVR variants, DirectIO uses some #define/#include tricks to define _SFR_ASM_COMPAT without breaking the Arduino toolchain. Something similar may be needed here.

I won't be able to work on this for a bit. If you are looking for a workaround, you could try #define __ASSEMBLY__ 1 and see if that works (or if it breaks something else in the toolchain, requiring similar trickery to the AVR configurations).

jakespeed1311 commented 4 years ago

hi, ok thats bad news, tanks. Jake

mmarchetti commented 4 years ago

If you try the workaround, please let me know whether it worked for you.

jakespeed1311 commented 4 years ago

Hello, no success, to be shure that i did notthing wrong here the code from direct_io_pin.ini examble. I have seen some definitions, i am not able to fix this Problem by my own.

`

Source Excamble

define ASSEMBLY 1

include

OutputPin pin(2);

void setup() {}

void loop() { while(1) { pin = HIGH; pin = LOW; } }

##################### `

Terminal Output ##################

Processing due (platform: atmelsam; board: due; framework: arduino)

Verbose mode can be enabled via -v, --verbose option CONFIGURATION: https://docs.platformio.org/page/boards/atmelsam/due.html PLATFORM: Atmel SAM 4.1.0 > Arduino Due (Programming Port) HARDWARE: AT91SAM3X8E 84MHz, 96KB RAM, 512KB Flash DEBUG: Current (atmel-ice) External (atmel-ice, blackmagic, jlink, stlink) PACKAGES:

#