redbear / Duo

Resources for the RedBear Duo IoT development board.
http://redbear.cc/duo
228 stars 107 forks source link

digitalPinToInterrupt() missing #13

Closed dspdon closed 8 years ago

dspdon commented 8 years ago

I'm attempting to compile some legacy (but pretty recent) Arduino code for use with RedBear Duo. The digitalPinToInterrupt() definition is missing. This typically belongs in pins_arduino.h

Code fails to compile as shown:

C:\Users\don_o\Work\ArduinoSketches\libraries\MAX31856\MAX31856.cpp:63:57: error: 'digitalPinToInterrupt' was not declared in this scope

   attachInterrupt(digitalPinToInterrupt(DataReadyPin),
dspdon commented 8 years ago

Looking at the current folder tree, it may be simple to add this macro to: ...\X_hal\inc\pinmap_hal.h but it seems best to keep to the standard Arduino file hierarchy by adding a new "pins_arduino.h" file here: ...\STM32F2\0.2.6\variants\RedBear_Duo\pins_arduino.h

I'm seeing similar errors about missing definitions in the SPI interface (no BitOrder type, etc).

dspdon commented 8 years ago

I learned that the interrupts on Duo take a pin number, not interrupt number. Seems better overall, but this is compatible with some legacy code. Closing this issue.