modified for nuc472
Dependents: modbus-over-rs485-sample NTOUEE-mbed-modbus-RTU NuMaker_NuWicam_Lite
Fork of Modbus by
Diff: portserial.cpp
- Revision:
- 7:be466464a18c
- Parent:
- 6:08849dd9654d
--- a/portserial.cpp Wed Jan 04 08:31:29 2017 +0000 +++ b/portserial.cpp Fri Oct 06 02:54:27 2017 +0000 @@ -38,20 +38,26 @@ //#define DEF_RS485_PORT 1 /* ----------------------- System Variables ---------------------------------*/ -#if defined(DEF_RS485_PORT) // mbed serial port +#if defined(MBED_CONF_APP_DEF_RS485_PORT) && (MBED_CONF_APP_DEF_RS485_PORT)// mbed serial port #include "nvt_rs485.h" // RS485 TX, RX, RTS pins - #if defined(TARGET_NUMAKER_PFM_NUC472) // for NUC472 board + #if defined(TARGET_NUMAKER_PFM_NUC472) // for NUC472 board NvtRS485 pc(PF_13, PF_14, PF_11); #elif defined(TARGET_NUMAKER_PFM_M453) // for M453 board NvtRS485 pc(PE_8, PE_9, PE_11); + #else + #error "The demo code can't be executed on this board." #endif #else //UART TX, RX - #if defined(TARGET_NUMAKER_PFM_NUC472) // for NUC472 board + #if defined(TARGET_NUMAKER_PFM_NUC472) // for NUC472 board Serial pc(PG_2, PG_1); #elif defined(TARGET_NUMAKER_PFM_M453) // for M453 board Serial pc(PD_1, PD_6); + #elif defined(TARGET_NUMAKER_PFM_M487) // for M478 board + Serial pc(PC_12, PC_11); + #else + #error "The demo code can't be executed on this board." #endif #endif