makefile and baudrate
This commit is contained in:
parent
9dd62f109a
commit
7898b6fde8
@ -14,6 +14,10 @@ mbusgw.o: mbusgw.c mbusgw.h
|
||||
.PHONY: all
|
||||
all: mbusgw
|
||||
|
||||
.PHONY: install
|
||||
install: all
|
||||
sudo cp mbusgw /usr/local/bin/
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
-rm -f *.o mbusgw
|
||||
|
@ -479,7 +479,7 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
|
||||
infolog("opening device\n");
|
||||
int fd = openSerial(DEFAULT_SERIAL_DEVICE, 2400);
|
||||
int fd = openSerial(DEFAULT_SERIAL_DEVICE, BAUDRATE);
|
||||
if (fd == -1) {
|
||||
errlog("unable to open device, fatal error\n");
|
||||
myExit(-1);
|
||||
|
@ -16,6 +16,8 @@
|
||||
|
||||
#define DEFAULT_SERIAL_DEVICE "/dev/ttyAMA0"
|
||||
|
||||
#define BAUDRATE 2400
|
||||
|
||||
|
||||
#define SUCCESS 0
|
||||
#define ERROR_TIMEOUT 1
|
||||
@ -52,4 +54,4 @@ typedef struct {
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user