File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
examples/NonReg/SerialLoop Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change 1414
1515/*
1616 * 1 - Connect Rx/Tx of the desired Serial
17- * 2 - Define SERIAL_PORT_TESTED by setting Serial number to use 1,2,...
18- * ! Ensure Serial feature is enabled thanks 'Serial interface menu'!
17+ * 2 - Define UART_TEST_INSTANCE
18+ * ! Ensure Serial feature is enabled thanks 'U(S)ART support menu'!
1919 * 3 - Optionnal: comment unwanted speed in serialSpeed array.
2020 */
21- #if defined(SERIAL_UART_INSTANCE) && (SERIAL_UART_INSTANCE == 2)
22- #define SERIAL_PORT_TESTED Serial1
23- HardwareSerial Serial1 (USART1);
21+ #define SERIAL_PORT_TESTED SerialTest
22+ #if defined(SERIAL_UART_INSTANCE) && (SERIAL_UART_INSTANCE != 1)
23+ #define UART_TEST_INSTANCE USART1
24+ #elif defined(USART2_BASE)
25+ #define UART_TEST_INSTANCE USART2
2426#else
25- #define SERIAL_PORT_TESTED Serial2
26- HardwareSerial Serial2 (USART2);
27+ #define UART_TEST_INSTANCE LPUART1
2728#endif
2829// or
2930// HardwareSerial Serialx(rxpin, txpin)
31+ HardwareSerial SERIAL_PORT_TESTED (UART_TEST_INSTANCE);
3032
3133#define DECL_CONFIG (x ) {#x, x}
3234
You can’t perform that action at this time.
0 commit comments