From a1feb32fe3a4a70dcbbe2de36a3a43c4cd657a58 Mon Sep 17 00:00:00 2001 From: Markus Hitter Date: Tue, 4 Aug 2015 23:01:43 +0200 Subject: [PATCH] serial.c/.h: remove serial_writeblock() and ..._P(). Never used, all "blocks" we write are strings. --- serial.c | 30 ++++++------------------------ serial.h | 5 ----- 2 files changed, 6 insertions(+), 29 deletions(-) diff --git a/serial.c b/serial.c index a7a0bd4..46adcd3 100644 --- a/serial.c +++ b/serial.c @@ -217,15 +217,6 @@ void serial_writechar(uint8_t data) } #endif /* USB_SERIAL */ -/// send a whole block -void serial_writeblock(void *data, int datalen) -{ - int i; - - for (i = 0; i < datalen; i++) - serial_writechar(((uint8_t *) data)[i]); -} - /// send a string- look for null byte instead of expecting a length void serial_writestr(uint8_t *data) { @@ -236,24 +227,15 @@ void serial_writestr(uint8_t *data) } /** - Write block from FLASH + Write string from FLASH. - Extensions to output flash memory pointers. This prevents the data to - become part of the .data segment instead of the .code segment. That means - less memory is consumed for multi-character writes. + Extensions to output flash memory pointers. This prevents the data to + become part of the .data segment instead of the .code segment. That means + less memory is consumed for multi-character writes. - For single character writes (i.e. '\n' instead of "\n"), using - serial_writechar() directly is the better choice. + For single character writes (i.e. '\n' instead of "\n"), using + serial_writechar() directly is the better choice. */ -void serial_writeblock_P(PGM_P data_P, int datalen) -{ - int i; - - for (i = 0; i < datalen; i++) - serial_writechar(pgm_read_byte(&data_P[i])); -} - -/// Write string from FLASH void serial_writestr_P(PGM_P data_P) { uint8_t r, i = 0; diff --git a/serial.h b/serial.h index cf96220..6e36228 100644 --- a/serial.h +++ b/serial.h @@ -29,14 +29,9 @@ void serial_writechar(uint8_t data); #endif /* USB_SERIAL */ -// read/write many characters -// uint8_t serial_recvblock(uint8_t *block, int blocksize); -void serial_writeblock(void *data, int datalen); - void serial_writestr(uint8_t *data); // write from flash -void serial_writeblock_P(PGM_P data_P, int datalen); void serial_writestr_P(PGM_P data_P); #endif /* _SERIAL_H */