Skip to content

Commit

Permalink
Put strings in PROGMEM, strip CRLF in text files only
Browse files Browse the repository at this point in the history
  • Loading branch information
dak664 committed Jun 19, 2009
1 parent 17da57e commit e7bc9f2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tools/avr-makefsdata
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ foreach $file (@files) {
print "Adding file $file\n";

open(FILE, $file) || die "Could not open file $file\n";
binmode FILE;
if (grep /.png/,$file) {binmode FILE;}
if (grep /.jpg/,$file) {binmode FILE;}
if (grep /.gif/,$file) {binmode FILE;}
$file =~ s-^-/-;
$fvar = $file;
$fvar =~ s-/-_-g;
Expand Down Expand Up @@ -69,7 +72,8 @@ for($i = 0; $i < @fvars; $i++) {
} else {
$prevfile = "file" . $fvars[$i - 1];
}
print(OUTPUT "const struct httpd_fsdata_file file".$fvar."[] = {{$prevfile, data$fvar, ");
# for AVR, add PROGMEM here
print(OUTPUT "const struct httpd_fsdata_file file".$fvar."[] PROGMEM = {{$prevfile, data$fvar, ");
print(OUTPUT "data$fvar + ". (length($file) + 1) .", ");
print(OUTPUT "sizeof(data$fvar) - ". (length($file) + 1) ."}};\n\n");
}
Expand Down

0 comments on commit e7bc9f2

Please sign in to comment.