Skip to content

Commit

Permalink
Update (and fix) the chaucer* sketches (for testing big uploads.)
Browse files Browse the repository at this point in the history
update progmem usage (const char instead of prog_char)
use pgm_read_byte_far() where needed.
reset counter i in between segments when printing.
  • Loading branch information
WestfW committed Jul 26, 2018
1 parent 5803649 commit a2e1f3b
Show file tree
Hide file tree
Showing 7 changed files with 3,709 additions and 3,692 deletions.
2,355 changes: 2,355 additions & 0 deletions optiboot/examples/chaucer112k/chaucer112k.ino

Large diffs are not rendered by default.

2,347 changes: 0 additions & 2,347 deletions optiboot/examples/chaucer112k/chaucer112k.pde

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Full text at http://www.gutenberg.org/dirs/etext00/cbtls12.txt
#include <avr/pgmspace.h>

prog_char knightsTale[] PROGMEM= {
const char knightsTale[] PROGMEM= {
" THE KNIGHT'S TALE <1>\n"
"\n"
"\n"
Expand Down Expand Up @@ -295,10 +295,10 @@ prog_char knightsTale[] PROGMEM= {
void setup() {
int i=0;
uint8_t c;
Serial.begin(9600);
Serial.begin(115200);
do {
c = pgm_read_byte(knightsTale+i);
if (c) Serial.print(c,BYTE);
if (c) Serial.write(c);
i++;
} while (c);
}
Expand Down
20 changes: 13 additions & 7 deletions optiboot/examples/chaucer256k/chaucer256k.ino
Original file line number Diff line number Diff line change
Expand Up @@ -3736,37 +3736,43 @@ const char knightsTale6[] PROGMEM= {
void setup() {
int i=0;
uint8_t c;
Serial.begin(9600);
Serial.begin(115200);
do {
c = pgm_read_byte(knightsTale+i);
c = pgm_read_byte_far(pgm_get_far_address(knightsTale)+i);
if (c) Serial.write(c);
i++;
} while (c);
i = 0;
do {
c = pgm_read_byte(knightsTale2+i);
c = pgm_read_byte_far(pgm_get_far_address(knightsTale2)+i);
if (c) Serial.write(c);
i++;
} while (c);
i = 0;
do {
c = pgm_read_byte(knightsTale3+i);
c = pgm_read_byte_far(pgm_get_far_address(knightsTale3)+i);
if (c) Serial.write(c);
i++;
} while (c);
i = 0;
do {
c = pgm_read_byte(knightsTale4+i);
c = pgm_read_byte_far(pgm_get_far_address(knightsTale4)+i);
if (c) Serial.write(c);
i++;
} while (c);
i = 0;
do {
c = pgm_read_byte(knightsTale5+i);
c = pgm_read_byte_far(pgm_get_far_address(knightsTale5)+i);
if (c) Serial.write(c);
i++;
} while (c);
i = 0;
do {
c = pgm_read_byte(knightsTale6+i);
c = pgm_read_byte_far(pgm_get_far_address(knightsTale6)+i);
if (c) Serial.write(c);
i++;
} while (c);
}

void loop() {
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Full text at http://www.gutenberg.org/dirs/etext00/cbtls12.txt
#include <avr/pgmspace.h>

prog_char knightsTale[] PROGMEM= {
const char knightsTale[] PROGMEM= {
" THE KNIGHT'S TALE <1>\n"
"\n"
"\n"
Expand Down Expand Up @@ -668,10 +668,10 @@ prog_char knightsTale[] PROGMEM= {
void setup() {
int i=0;
uint8_t c;
Serial.begin(9600);
Serial.begin(115200);
do {
c = pgm_read_byte(knightsTale+i);
if (c) Serial.print(c,BYTE);
if (c) Serial.write(c);
i++;
} while (c);
}
Expand Down
Loading

0 comments on commit a2e1f3b

Please sign in to comment.