Skip to content

Commit

Permalink
Fix for Arduino issue 509 'sequence point'
Browse files Browse the repository at this point in the history
  • Loading branch information
Randall Bohn (Huckle) committed Nov 19, 2011
1 parent bc480b0 commit d33d789
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions ArduinoISP/ArduinoISP.pde
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
// 8: Error - Lights up if something goes wrong (use red if that makes sense)
// 7: Programming - In communication with the slave
//
// 23 July 2011 Randall Bohn
// -Address Arduino issue 509 :: Portability of ArduinoISP
// http://code.google.com/p/arduino/issues/detail?id=509
//
// October 2010 by Randall Bohn
// - Write to EEPROM > 256 bytes
// - Better use of LEDs:
Expand Down Expand Up @@ -360,7 +364,8 @@ uint8_t write_eeprom_chunk(int start, int length) {

void program_page() {
char result = (char) STK_FAILED;
int length = 256 * getch() + getch();
int length = 256 * getch();
length += getch();
char memtype = getch();
// flash memory @here, (length) bytes
if (memtype == 'F') {
Expand Down Expand Up @@ -413,7 +418,8 @@ char eeprom_read_page(int length) {

void read_page() {
char result = (char)STK_FAILED;
int length = 256 * getch() + getch();
int length = 256 * getch();
length += getch();
char memtype = getch();
if (CRC_EOP != getch()) {
error++;
Expand Down Expand Up @@ -481,7 +487,8 @@ int avrisp() {
empty_reply();
break;
case 'U': // set address (word)
here = getch() + 256 * getch();
here = getch();
here += 256 * getch();
empty_reply();
break;

Expand Down

0 comments on commit d33d789

Please sign in to comment.