diff --git a/avr/Makefile b/avr/Makefile index f85ac71..895dc65 100644 --- a/avr/Makefile +++ b/avr/Makefile @@ -24,17 +24,17 @@ HEADERS_BUILD = $(HEADERS_LOCAL) \ $(addprefix $(INCLUDE_PATH)/$(HEADER_SUBDIR)/,$(HEADERS)) HEADERS = avr.h avr/uart.h avr/link.h avr/printer.h link.h printer.h -OBJS = send.o recv.o printer.o link.o uart.o +OBJS = print.o capture.o printer.o link.o uart.o -RECV_NAME = recv +RECV_NAME = capture RECV_BIN = $(RECV_NAME).bin RECV_ELF = $(RECV_NAME).elf -RECV_OBJS = recv.o printer.o link.o uart.o +RECV_OBJS = capture.o printer.o link.o uart.o -SEND_NAME = send +SEND_NAME = print SEND_BIN = $(SEND_NAME).bin SEND_ELF = $(SEND_NAME).elf -SEND_OBJS = send.o printer.o link.o uart.o +SEND_OBJS = print.o printer.o link.o uart.o IMAGES_BIN = $(RECV_BIN) $(SEND_BIN) IMAGES_ELF = $(RECV_ELF) $(SEND_ELF) @@ -55,10 +55,10 @@ $(RECV_ELF): $(RECV_OBJS) $(OBJS): %.o: %.c $(HEADERS_BUILD) $(CC) $(CFLAGS) -c $< -flash-send: $(SEND_BIN) +flash-print: $(SEND_BIN) $(AVRDUDE) $(AVRDUDE_FLAGS) -U flash:w:$(SEND_BIN):r -flash-recv: $(RECV_BIN) +flash-capture: $(RECV_BIN) $(AVRDUDE) $(AVRDUDE_FLAGS) -U flash:w:$(RECV_BIN):r clean: diff --git a/avr/recv.c b/avr/capture.c similarity index 100% rename from avr/recv.c rename to avr/capture.c diff --git a/avr/send.c b/avr/print.c similarity index 97% rename from avr/send.c rename to avr/print.c index aef40d9..623e45a 100644 --- a/avr/send.c +++ b/avr/print.c @@ -150,7 +150,7 @@ int main() { if (sum_footer != sum_calc) { response.status |= TABBY_PRINTER_SUM; } else if (header.type == TABBY_PRINTER_PACKET_JOB) { - tabby_avr_printer_send_sheet(sheet, + tabby_avr_printer_sheet_send(sheet, offset_sheet, &response); @@ -158,7 +158,7 @@ int main() { offset_sheet = 0; } else if (header.type == TABBY_PRINTER_PACKET_INQUIRY) { - tabby_avr_printer_send_inquiry(&response); + tabby_avr_printer_inquiry_send(&response); } respond: diff --git a/avr/printer.c b/avr/printer.c index 17000d6..2ff94c1 100644 --- a/avr/printer.c +++ b/avr/printer.c @@ -37,7 +37,7 @@ static uint16_t checksum(tabby_printer_packet *header, uint8_t *body) { return sum; } -void tabby_avr_printer_send_packet(uint8_t type, +void tabby_avr_printer_packet_send(uint8_t type, uint8_t *body, uint16_t size, tabby_printer_response *response) { @@ -68,14 +68,14 @@ void tabby_avr_printer_send_packet(uint8_t type, } void tabby_avr_printer_init(tabby_printer_response *response) { - tabby_avr_printer_send_packet(TABBY_PRINTER_PACKET_INIT, + tabby_avr_printer_packet_send(TABBY_PRINTER_PACKET_INIT, NULL, 0, response); } -void tabby_avr_printer_send_inquiry(tabby_printer_response *response) { - tabby_avr_printer_send_packet(TABBY_PRINTER_PACKET_INQUIRY, +void tabby_avr_printer_inquiry_send(tabby_printer_response *response) { + tabby_avr_printer_packet_send(TABBY_PRINTER_PACKET_INQUIRY, NULL, 0, response); @@ -83,22 +83,22 @@ void tabby_avr_printer_send_inquiry(tabby_printer_response *response) { void tabby_avr_printer_job_start(tabby_printer_job *job, tabby_printer_response *response) { - tabby_avr_printer_send_packet(TABBY_PRINTER_PACKET_JOB, + tabby_avr_printer_packet_send(TABBY_PRINTER_PACKET_JOB, job->data, sizeof(*job), response); } -void tabby_avr_printer_send_data(uint8_t *data, +void tabby_avr_printer_data_send(uint8_t *data, uint16_t size, tabby_printer_response *response) { - tabby_avr_printer_send_packet(TABBY_PRINTER_PACKET_DATA, + tabby_avr_printer_packet_send(TABBY_PRINTER_PACKET_DATA, data, size, response); } -void tabby_avr_printer_send_sheet(uint8_t *sheet, +void tabby_avr_printer_sheet_send(uint8_t *sheet, uint16_t size, tabby_printer_response *response) { int i; @@ -106,11 +106,11 @@ void tabby_avr_printer_send_sheet(uint8_t *sheet, tabby_avr_printer_init(response); for (i=0; i