mirror of https://github.com/ARMmbed/mbed-os.git
Ported more tests to NUCLEO_F103RB
parent
a164c6f498
commit
f5e1f7037f
|
@ -1,9 +1,17 @@
|
||||||
#include "mbed.h"
|
#include "mbed.h"
|
||||||
|
|
||||||
|
#ifdef TARGET_NUCLEO_F103RB
|
||||||
|
#define TXPIN SERIAL_TX
|
||||||
|
#define RXPIN SERIAL_RX
|
||||||
|
#else
|
||||||
|
#define TXPIN USBTX
|
||||||
|
#define RXPIN USBRX
|
||||||
|
#endif
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
char buf[256];
|
char buf[256];
|
||||||
|
|
||||||
Serial pc(USBTX, USBRX);
|
Serial pc(TXPIN, RXPIN);
|
||||||
pc.baud(115200);
|
pc.baud(115200);
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
|
|
|
@ -30,6 +30,8 @@ static const int i2c_delay_us = 0;
|
||||||
|
|
||||||
#if defined(TARGET_KL25Z)
|
#if defined(TARGET_KL25Z)
|
||||||
I2C i2c(PTE0, PTE1);
|
I2C i2c(PTE0, PTE1);
|
||||||
|
#elif defined(TARGET_NUCLEO_F103RB)
|
||||||
|
I2C i2c(I2C_SDA, I2C_SCL);
|
||||||
#else
|
#else
|
||||||
I2C i2c(p28, p27);
|
I2C i2c(p28, p27);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -6,7 +6,7 @@ DigitalOut led2(LED2);
|
||||||
#ifndef TARGET_NUCLEO_F103RB
|
#ifndef TARGET_NUCLEO_F103RB
|
||||||
Serial computer(USBTX, USBRX);
|
Serial computer(USBTX, USBRX);
|
||||||
#else
|
#else
|
||||||
Serial computer(UART_TX, UART_RX);
|
Serial computer(SERIAL_TX, SERIAL_RX);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// This function is called when a character goes into the TX buffer.
|
// This function is called when a character goes into the TX buffer.
|
||||||
|
|
Loading…
Reference in New Issue