- fix typo recchar()
- fix flash read/write for mega128
This commit is contained in:
Olaf Rempel 2006-05-26 19:26:19 +02:00
parent 11b8928759
commit 2dca010c7d

12
main.c
View File

@ -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');