diff --git a/main.c b/main.c index b58de77..61da54f 100644 --- a/main.c +++ b/main.c @@ -151,7 +151,7 @@ static inline void recvBuffer(pagebuf_t size) static inline uint16_t writeFlashPage(uint16_t waddr, pagebuf_t size) { - uint32_t pagestart = waddr<<1; + uint32_t pagestart = (uint32_t)waddr<<1; uint32_t baddr = pagestart; uint16_t data; pagebuf_t cnt = 0; @@ -194,7 +194,7 @@ static inline uint16_t writeEEpromPage(uint16_t address, pagebuf_t size) static inline uint16_t readFlashPage(uint16_t waddr, pagebuf_t size) { - uint32_t baddr = waddr<<1; + uint32_t baddr = (uint32_t)waddr<<1; uint16_t data; do { @@ -297,13 +297,13 @@ int main(void) jump_to_app(); // Jump to application sector } else { - val = recchar(); + val = recvchar(); /* ESC */ if (val == 0x1B) { // AVRPROG connection // Wait for signon while (val != 'S') - val = recchar(); + val = recvchar(); send_boot(); // Report signon OK = 0; @@ -442,8 +442,8 @@ int main(void) // write lockbits } else if (val == 'l') { if (device == DEVTYPE) { - // write_lock_bits(recchar()); - boot_lock_bits_set(recchar()); // boot.h takes care of mask + // write_lock_bits(recvchar()); + boot_lock_bits_set(recvchar()); // boot.h takes care of mask boot_spm_busy_wait(); } sendchar('\r');