Move SDA/SCL pins into pins.h for fastio compatibility

fastio relies on macros for pin definitions, so we cannot use the const
declaration in Sd2PinMap or the arduino's definition.

Declare SDA/SCL_PIN into pins.h based on the current MCU, which is
identical in all our variants.

Remove the conflicting/unused declaration in Sd2PinMap.
This commit is contained in:
Yuri D'Elia 2021-01-29 17:48:59 +01:00
parent 30262b0a6e
commit 1fa7b8cd8d
2 changed files with 6 additions and 5 deletions

View File

@ -37,10 +37,6 @@ struct pin_map_t {
|| defined(__AVR_ATmega2560__) || defined(__AVR_ATmega2560__)
// Mega // Mega
// Two Wire (aka I2C) ports
uint8_t const SDA_PIN = 20; // D1
uint8_t const SCL_PIN = 21; // D0
#undef MOSI_PIN #undef MOSI_PIN
#undef MISO_PIN #undef MISO_PIN
// SPI port // SPI port
@ -365,4 +361,4 @@ static inline __attribute__((always_inline))
#endif // Sd2PinMap_h #endif // Sd2PinMap_h
#endif #endif

View File

@ -25,6 +25,11 @@
#error Unknown MOTHERBOARD value in configuration.h #error Unknown MOTHERBOARD value in configuration.h
#endif #endif
#if !defined(SDA_PIN) && (defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__))
#define SDA_PIN 20
#define SCL_PIN 21
#endif
//List of pins which to ignore when asked to change by gcode, 0 and 1 are RX and TX, do not mess with those! //List of pins which to ignore when asked to change by gcode, 0 and 1 are RX and TX, do not mess with those!
#define _E0_PINS E0_STEP_PIN, E0_DIR_PIN, E0_ENABLE_PIN, HEATER_0_PIN, #define _E0_PINS E0_STEP_PIN, E0_DIR_PIN, E0_ENABLE_PIN, HEATER_0_PIN,
#if EXTRUDERS > 1 #if EXTRUDERS > 1