diff --git a/avr/send.c b/avr/send.c index 8109541..eade828 100644 --- a/avr/send.c +++ b/avr/send.c @@ -15,7 +15,7 @@ static tabby_printer_packet header = { static tabby_printer_response response; -static uint8_t body[TABBY_PRINTER_MAX_PACKET_SIZE]; +static uint8_t body[TABBY_PRINTER_PACKET_MAX_SIZE]; static uint16_t sum = 0x0000; diff --git a/include/tabby/avr.h b/include/tabby/avr.h index 34353c6..1b1d5bb 100644 --- a/include/tabby/avr.h +++ b/include/tabby/avr.h @@ -3,6 +3,9 @@ #define SPI_PULSE_USEC 61 +/* + * SC -- Serial Clock + */ #define SC_DDR DDRB #define SC_DDB DDB5 #define SC_PORT PORTB @@ -20,6 +23,9 @@ #define SC_LOW() \ (SC_PORT &= ~(1 << SC_PORT_PIN)) +/* + * SI -- Serial In + */ #define SI_DDR DDRB #define SI_DDB DDB3 #define SI_PIN_REG PINB @@ -36,6 +42,9 @@ #define SI_IS_HIGH() \ (SI_PIN_REG & (1 << SI_PIN)) +/* + * SO -- Serial Out + */ #define SO_DDR DDRB #define SO_DDB DDB4 #define SO_PORT PORTB diff --git a/include/tabby/printer.h b/include/tabby/printer.h index 223f6a4..dd55225 100644 --- a/include/tabby/printer.h +++ b/include/tabby/printer.h @@ -7,7 +7,7 @@ #define TABBY_PRINTER_DEVICE_ID 0x81 #define TABBY_PRINTER_RETRY_COUNT 5 -#define TABBY_PRINTER_MAX_PACKET_SIZE 640 +#define TABBY_PRINTER_PACKET_MAX_SIZE 640 #define TABBY_PRINTER_BAND_SIZE 640 #define TABBY_PRINTER_SHEET_BANDS 9 @@ -56,14 +56,11 @@ typedef struct _tabby_printer_packet { }; } tabby_printer_packet; -typedef struct _tabby_printer_job_packet { +typedef struct _tabby_printer_buffer { tabby_printer_packet header; - - uint8_t sheets, - linefeeds, - palette, - density; -} tabby_printer_job_packet; + uint8_t body[TABBY_PRINTER_PACKET_MAX_SIZE]; + uint16_t sum; +} tabby_printer_buffer; typedef struct _tabby_printer_response { uint8_t device;