File tree 1 file changed +9
-7
lines changed
examples/NonReg/SerialLoop
1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change 14
14
15
15
/*
16
16
* 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'!
19
19
* 3 - Optionnal: comment unwanted speed in serialSpeed array.
20
20
*/
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
24
26
#else
25
- #define SERIAL_PORT_TESTED Serial2
26
- HardwareSerial Serial2 (USART2);
27
+ #define UART_TEST_INSTANCE LPUART1
27
28
#endif
28
29
// or
29
30
// HardwareSerial Serialx(rxpin, txpin)
31
+ HardwareSerial SERIAL_PORT_TESTED (UART_TEST_INSTANCE);
30
32
31
33
#define DECL_CONFIG (x ) {#x, x}
32
34
You can’t perform that action at this time.
0 commit comments