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