Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d33d789

Browse files
author
Randall Bohn (Huckle)
committed
Fix for Arduino issue 509 'sequence point'
1 parent bc480b0 commit d33d789

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

ArduinoISP/ArduinoISP.pde

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
// 8: Error - Lights up if something goes wrong (use red if that makes sense)
1111
// 7: Programming - In communication with the slave
1212
//
13+
// 23 July 2011 Randall Bohn
14+
// -Address Arduino issue 509 :: Portability of ArduinoISP
15+
// http://code.google.com/p/arduino/issues/detail?id=509
16+
//
1317
// October 2010 by Randall Bohn
1418
// - Write to EEPROM > 256 bytes
1519
// - Better use of LEDs:
@@ -360,7 +364,8 @@ uint8_t write_eeprom_chunk(int start, int length) {
360364

361365
void program_page() {
362366
char result = (char) STK_FAILED;
363-
int length = 256 * getch() + getch();
367+
int length = 256 * getch();
368+
length += getch();
364369
char memtype = getch();
365370
// flash memory @here, (length) bytes
366371
if (memtype == 'F') {
@@ -413,7 +418,8 @@ char eeprom_read_page(int length) {
413418

414419
void read_page() {
415420
char result = (char)STK_FAILED;
416-
int length = 256 * getch() + getch();
421+
int length = 256 * getch();
422+
length += getch();
417423
char memtype = getch();
418424
if (CRC_EOP != getch()) {
419425
error++;
@@ -481,7 +487,8 @@ int avrisp() {
481487
empty_reply();
482488
break;
483489
case 'U': // set address (word)
484-
here = getch() + 256 * getch();
490+
here = getch();
491+
here += 256 * getch();
485492
empty_reply();
486493
break;
487494

0 commit comments

Comments
 (0)