mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-18 12:52:44 +01:00
sys/arduino: add possibility to customize Arduino serial port at compile time
This commit is contained in:
parent
94adf875c0
commit
a89e43ae31
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user