cleanup uploader code
This commit is contained in:
@@ -36,6 +36,7 @@ uint8_t rle_decode(PGM_VOID_P in_addr, int32_t in_len, uint32_t out_addr)
|
||||
uint8_t in_byte, in_repeat, last_byte;
|
||||
uint32_t out_len, out_len_left;
|
||||
printf("RLE decode len=%li addr=0x%08lx\n",in_len,out_addr);
|
||||
last_byte = 0;
|
||||
|
||||
out_len_left = out_len;
|
||||
sram_bulk_write_start(out_addr);
|
||||
@@ -56,18 +57,11 @@ uint8_t rle_decode(PGM_VOID_P in_addr, int32_t in_len, uint32_t out_addr)
|
||||
out_addr++;\
|
||||
} while(0)
|
||||
|
||||
/*
|
||||
** Handle first byte separately (since we have to get angry
|
||||
** in case of an orphaned RLE code).
|
||||
*/
|
||||
INBYTE(in_byte);
|
||||
|
||||
if (in_byte == RUNCHAR) {
|
||||
INBYTE(in_repeat);
|
||||
if (in_repeat != 0) {
|
||||
/* Note Error, not Incomplete (which is at the end
|
||||
** of the string only). This is a programmer error.
|
||||
*/
|
||||
printf("Orphaned RLE code at start\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user