You gain some, you lose some

This commit is contained in:
XANTRONIX Development 2016-06-05 15:06:57 -05:00
parent a2c079bf90
commit 2906e26df5
3 changed files with 15 additions and 9 deletions

View file

@ -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;

View file

@ -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

View file

@ -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;