Commit 72634781 authored by Hugo Hörnquist's avatar Hugo Hörnquist

Change serial lib to be more sensible.

parent 3ae128ed
......@@ -9,12 +9,12 @@ CFLAGS=-Wall -fPIC -pedantic
%: %.o
$(CC) -o $@ $<
libcom.so: cash_drawer.o
$(CC) -shared -o $@ $<
libcom.a: cash_drawer.o
ar rcs $@ $<
all: libcom.so libcom.a
libcom.so: serial.o
$(CC) -shared -o $@ $^
all: libcom.so
clean:
-rm main
-rm libcom.so
-rm *.o
#include <stdio.h>
#include <errno.h>
#include "cash_drawer.h"
#include "serial.h"
#define COM "/dev/serial/by-id/usb-Arduino__www.arduino.cc__0043_553383436393514032C0-if00"
#define SYN 0x16
......
#include "cash_drawer.h"
#include "serial.h"
#include <termios.h>
#include <unistd.h>
......
#ifndef CASH_DRAWER_H
#define CASH_DRAWER_H
#ifndef SERIAL_H
#define SERIAL_H
#ifdef __cplusplus
extern "C" {
#endif
#include <termios.h>
#include <unistd.h>
......@@ -8,4 +12,8 @@ int port_setup (const char* path, speed_t speed);
int port_write (int fd, char data);
int port_close (int fd);
#endif // CASH_DRAWER_H
#ifdef __cplusplus
}
#endif
#endif /* SERIAL_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment