From 06503a351038d12e08f70e4805f8895edac24535 Mon Sep 17 00:00:00 2001 From: XANTRONIX Development Date: Mon, 6 Jun 2016 21:04:19 -0500 Subject: [PATCH] HAHAHA I DON'T FUCKING NEED YOU ANY LONGER --- avr/send.c | 10 ---------- include/tabby/printer.h | 2 -- src/link.c | 2 +- src/printer.c | 17 ----------------- 4 files changed, 1 insertion(+), 30 deletions(-) diff --git a/avr/send.c b/avr/send.c index fcbfffb..b3d1c17 100644 --- a/avr/send.c +++ b/avr/send.c @@ -35,16 +35,6 @@ int main() { sei(); - while (1) { - uart_putchar('O', NULL); - - c = uart_getchar(NULL); - - if (c == 'K') { - break; - } - } - while (1) { c = uart_getchar(NULL); diff --git a/include/tabby/printer.h b/include/tabby/printer.h index 3fbbcde..6fab3bf 100644 --- a/include/tabby/printer.h +++ b/include/tabby/printer.h @@ -81,8 +81,6 @@ typedef struct _tabby_printer_response { uint8_t status; } tabby_printer_response; -int tabby_printer_link_init(int fd); - /* * For receiving printer data packets from a Game Boy Camera */ diff --git a/src/link.c b/src/link.c index 7f52ac6..f52b2f5 100644 --- a/src/link.c +++ b/src/link.c @@ -25,7 +25,7 @@ int tabby_link_open(const char *dev) { attr.c_cc[VTIME] = 0; attr.c_cc[VMIN] = 1; - if (tcsetattr(fd, TCSANOW, &attr) < 0) { + if (tcsetattr(fd, TCSAFLUSH, &attr) < 0) { goto error_io; } diff --git a/src/printer.c b/src/printer.c index 6520598..d33d394 100644 --- a/src/printer.c +++ b/src/printer.c @@ -9,23 +9,6 @@ #define PACKET_RECV_ERROR_THRESHOLD 30 -int tabby_printer_link_init(int fd) { - uint8_t out = 'K', - in; - - while (1) { - read(fd, &in, 1); - - if (in == 'O') { - write(fd, &out, 1); - - break; - } - } - - return 0; -} - static uint16_t checksum(tabby_printer_packet *header, void *body) { uint16_t checksum = header->data[2] + header->data[3]