File tree Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 1
1
#include " mbed.h"
2
2
3
+ #ifdef TARGET_NUCLEO_F103RB
4
+ #define TXPIN SERIAL_TX
5
+ #define RXPIN SERIAL_RX
6
+ #else
7
+ #define TXPIN USBTX
8
+ #define RXPIN USBRX
9
+ #endif
10
+
3
11
int main () {
4
12
char buf[256 ];
5
13
6
- Serial pc (USBTX, USBRX );
14
+ Serial pc (TXPIN, RXPIN );
7
15
pc.baud (115200 );
8
16
9
17
while (1 ) {
Original file line number Diff line number Diff line change @@ -30,6 +30,8 @@ static const int i2c_delay_us = 0;
30
30
31
31
#if defined(TARGET_KL25Z)
32
32
I2C i2c (PTE0, PTE1);
33
+ #elif defined(TARGET_NUCLEO_F103RB)
34
+ I2C i2c (I2C_SDA, I2C_SCL);
33
35
#else
34
36
I2C i2c (p28, p27);
35
37
#endif
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ DigitalOut led2(LED2);
6
6
#ifndef TARGET_NUCLEO_F103RB
7
7
Serial computer (USBTX, USBRX);
8
8
#else
9
- Serial computer (UART_TX, UART_RX );
9
+ Serial computer (SERIAL_TX, SERIAL_RX );
10
10
#endif
11
11
12
12
// This function is called when a character goes into the TX buffer.
You can’t perform that action at this time.
0 commit comments