From: Jiří Matěják Date: Tue, 24 Apr 2018 15:36:48 +0000 (+0200) Subject: conditional beep X-Git-Url: https://rtime.felk.cvut.cz/gitweb/coffee/mt-apps.git/commitdiff_plain/fc572a44fa5508a743d39a0298d5b85465c8040a conditional beep --- diff --git a/Makefile b/Makefile index 95e4060..ee73c39 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,9 @@ SOURCE_FILES = mt_rfid.c OUTPUT_FILE = mt-rfid -UFR_LIB = -luFCoder-armhf +LIBRARIES = -lev -luFCoder-armhf all: $(SOURCE_FILES) - $(CC) $(CFLAGS) -o $(OUTPUT_FILE) $(SOURCE_FILES) $(UFR_LIB) + $(CC) $(CFLAGS) -o $(OUTPUT_FILE) $(SOURCE_FILES) $(LIBRARIES) .PHONY: clean diff --git a/mt_rfid.c b/mt_rfid.c index a16dffb..75f698f 100644 --- a/mt_rfid.c +++ b/mt_rfid.c @@ -119,7 +119,9 @@ static void ufr_read(char *uid) JSON_NUM(uid_size); JSON_NEXT(); JSON_STR(uid); JSON_END(); +#ifdef UFR_BEEP ReaderUISignal(0, 1); +#endif } static void ufr_cb(EV_P_ ev_io *w_, int revents) diff --git a/mt_rfid.h b/mt_rfid.h index 5d95960..d0a4cc8 100644 --- a/mt_rfid.h +++ b/mt_rfid.h @@ -26,6 +26,8 @@ typedef struct { #define ASYNC_BAUD_RATE 1000000 #define BASYNC_BAUD_RATE B1000000 +#define UFR_BEEP + // really simple JSON helpers #define JSON_NUM(NAME) printf("\"" #NAME "\": %d", NAME) #define JSON_STR(NAME) printf("\"" #NAME "\": \"%s\"", NAME)