makefile and baudrate

This commit is contained in:
Wolfgang Hottgenroth 2020-09-04 19:17:45 +01:00
parent 9dd62f109a
commit 7898b6fde8
3 changed files with 8 additions and 2 deletions

View File

@ -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

View File

@ -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);

View File

@ -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