serial.c/.h: remove serial_writeblock() and ..._P().

Never used, all "blocks" we write are strings.
This commit is contained in:
Markus Hitter 2015-08-04 23:01:43 +02:00
parent 7c8f1cec87
commit a1feb32fe3
2 changed files with 6 additions and 29 deletions

View File

@ -217,15 +217,6 @@ void serial_writechar(uint8_t data)
} }
#endif /* USB_SERIAL */ #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 /// send a string- look for null byte instead of expecting a length
void serial_writestr(uint8_t *data) void serial_writestr(uint8_t *data)
{ {
@ -236,7 +227,7 @@ 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 Extensions to output flash memory pointers. This prevents the data to
become part of the .data segment instead of the .code segment. That means become part of the .data segment instead of the .code segment. That means
@ -245,15 +236,6 @@ void serial_writestr(uint8_t *data)
For single character writes (i.e. '\n' instead of "\n"), using For single character writes (i.e. '\n' instead of "\n"), using
serial_writechar() directly is the better choice. 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) void serial_writestr_P(PGM_P data_P)
{ {
uint8_t r, i = 0; uint8_t r, i = 0;

View File

@ -29,14 +29,9 @@
void serial_writechar(uint8_t data); void serial_writechar(uint8_t data);
#endif /* USB_SERIAL */ #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); void serial_writestr(uint8_t *data);
// write from flash // write from flash
void serial_writeblock_P(PGM_P data_P, int datalen);
void serial_writestr_P(PGM_P data_P); void serial_writestr_P(PGM_P data_P);
#endif /* _SERIAL_H */ #endif /* _SERIAL_H */