1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

boards/wemos-zero: fix Arduio I/O Map

Two pins were incorrectly mapped because D2 and D4 are swapped on the
WeMos zero compared to the Arduino Zero. This takes the difference
into account.
This commit is contained in:
Marian Buschsieweke 2024-11-18 20:42:06 +01:00
parent c636f34eac
commit 5381b6187f
No known key found for this signature in database
GPG Key ID: 758BD52517F79C41

View File

@ -64,11 +64,22 @@ extern "C" {
* @name Mapping of MCU pins to Arduino pins * @name Mapping of MCU pins to Arduino pins
* @{ * @{
*/ */
/* The WeMos Zero / HW-819 has D2 and D4 swapped compared to official Arduino
* Zero, so we have to handle D2 and D4 differently depending on board */
#ifdef BOARD_WEMOS_ZERO
# define ARDUINO_PIN_2 GPIO_PIN(PA, 8)
# define ARDUINO_PIN_4 GPIO_PIN(PA, 14)
#else /* Official Arduino Zero or fully compatible: */
# define ARDUINO_PIN_2 GPIO_PIN(PA, 14)
# define ARDUINO_PIN_4 GPIO_PIN(PA, 8)
#endif
/* all other pins are identical for all currently supported Arduino Zero
* compatible boards */
#define ARDUINO_PIN_0 GPIO_PIN(PA, 11) #define ARDUINO_PIN_0 GPIO_PIN(PA, 11)
#define ARDUINO_PIN_1 GPIO_PIN(PA, 10) #define ARDUINO_PIN_1 GPIO_PIN(PA, 10)
#define ARDUINO_PIN_2 GPIO_PIN(PA, 14)
#define ARDUINO_PIN_3 GPIO_PIN(PA, 9) #define ARDUINO_PIN_3 GPIO_PIN(PA, 9)
#define ARDUINO_PIN_4 GPIO_PIN(PA, 8)
#define ARDUINO_PIN_5 GPIO_PIN(PA, 15) #define ARDUINO_PIN_5 GPIO_PIN(PA, 15)
#define ARDUINO_PIN_6 GPIO_PIN(PA, 20) #define ARDUINO_PIN_6 GPIO_PIN(PA, 20)
#define ARDUINO_PIN_7 GPIO_PIN(PA, 21) #define ARDUINO_PIN_7 GPIO_PIN(PA, 21)