Add modbus leader class & tester
This commit is contained in:
45
Modbus/src/tester.cpp
Normal file
45
Modbus/src/tester.cpp
Normal file
@@ -0,0 +1,45 @@
|
||||
#if defined (__USE_LPCOPEN)
|
||||
#if defined(NO_BOARD_LIB)
|
||||
#include "chip.h"
|
||||
#else
|
||||
#include "board.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <cr_section_macros.h>
|
||||
#include "ModbusMaster.h"
|
||||
// TODO: insert other include files here
|
||||
|
||||
// TODO: insert other definitions and declarations here
|
||||
|
||||
int main(void) {
|
||||
|
||||
#if defined (__USE_LPCOPEN)
|
||||
// Read clock settings and update SystemCoreClock variable
|
||||
SystemCoreClockUpdate();
|
||||
#if !defined(NO_BOARD_LIB)
|
||||
// Set up and initialize all required blocks and
|
||||
// functions related to the board hardware
|
||||
Board_Init();
|
||||
// Set the LED to the state of "On"
|
||||
Board_LED_Set(0, true);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// TODO: insert code here
|
||||
ModbusMaster MIO_12V(1);
|
||||
ModbusMaster CO2_sensor(240);
|
||||
ModbusMaster RH_sensor(241);
|
||||
|
||||
|
||||
// Force the counter to be placed into memory
|
||||
volatile static int i = 0 ;
|
||||
// Enter an infinite loop, just incrementing a counter
|
||||
while(1) {
|
||||
i++ ;
|
||||
// "Dummy" NOP to allow source level single
|
||||
// stepping of tight while() loop
|
||||
__asm volatile ("nop");
|
||||
}
|
||||
return 0 ;
|
||||
}
|
||||
Reference in New Issue
Block a user