[Bootloader]

- fixed check of BSEL

git-svn-id: http://moon:8086/svn/projects/HendiControl@154 fda53097-d464-4ada-af97-ba876c37ca34
This commit is contained in:
2019-03-29 23:02:27 +00:00
parent 7be8b7f51d
commit 1684218208
@@ -63,7 +63,7 @@ int port_init()
DDRB = 0x00;
DDRD = 0x40;
PORTD = 0x00;
return (PINB0 == 1);
return (PINB & 1 == 0);
}
int main(void)
@@ -74,12 +74,11 @@ int main(void)
State state_next;
srec_t srec;
cli();
bootloader_enter();
int bsel = port_init();
if (bsel)
{
bootloader_enter();
uart_init(9600);
uart_puts("Hendi-Control Bootloader v1.1\n");
size_t image_size = 0;
@@ -211,11 +210,10 @@ int main(void)
state = state_next;
}
} while (!leave_loop);
uart_puts("Exit bootloader!\n\n");
bootloader_exit();
}
bootloader_exit();
/* Return to address 0x0000 */
startApplication();