Skip to content
Snippets Groups Projects
Unverified Commit b08131c9 authored by Kevin "Bear Puncher" Weiss's avatar Kevin "Bear Puncher" Weiss Committed by GitHub
Browse files

Merge pull request #10154 from fedepell/arduino_3

sys/arduino: add possibility to customize Arduino serial port at compile time
parents 33aa604d a89e43ae
No related branches found
No related tags found
No related merge requests found
......@@ -112,6 +112,12 @@
* @endcode
* This links to the third entry in the `arduino_pinmap` array.
*
* - a define `ARDUINO_UART_DEV` that defines the UART to use as the Arduino
* primary serial port (default UART_DEV(0)):
* @code{c}
* #define ARDUINO_UART_DEV (UART_DEV(3))
* @endcode
*
* In addition, you have to add the 'arduino' feature to the board. For this,
* just add `FEATURES_PROVIDED += arduino` to the 'other features' section in
* your board's `Makefile.features'.
......
......@@ -45,10 +45,17 @@ enum {
HIGH = 1 /**< pin is set */
};
#ifndef ARDUINO_UART_DEV
/**
* @brief Primary serial port (mapped to UART_DEV(0))
* @brief UART device to use for Arduino serial
*/
static SerialPort Serial(UART_DEV(0));
#define ARDUINO_UART_DEV UART_DEV(0)
#endif
/**
* @brief Primary serial port (mapped to ARDUINO_UART_DEV)
*/
static SerialPort Serial(ARDUINO_UART_DEV);
/**
* @brief Configure a pin as either input or output
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment