[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:
@@ -63,7 +63,7 @@ int port_init()
|
|||||||
DDRB = 0x00;
|
DDRB = 0x00;
|
||||||
DDRD = 0x40;
|
DDRD = 0x40;
|
||||||
PORTD = 0x00;
|
PORTD = 0x00;
|
||||||
return (PINB0 == 1);
|
return (PINB & 1 == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
@@ -74,12 +74,11 @@ int main(void)
|
|||||||
State state_next;
|
State state_next;
|
||||||
srec_t srec;
|
srec_t srec;
|
||||||
cli();
|
cli();
|
||||||
|
|
||||||
bootloader_enter();
|
|
||||||
|
|
||||||
int bsel = port_init();
|
int bsel = port_init();
|
||||||
if (bsel)
|
if (bsel)
|
||||||
{
|
{
|
||||||
|
bootloader_enter();
|
||||||
uart_init(9600);
|
uart_init(9600);
|
||||||
uart_puts("Hendi-Control Bootloader v1.1\n");
|
uart_puts("Hendi-Control Bootloader v1.1\n");
|
||||||
size_t image_size = 0;
|
size_t image_size = 0;
|
||||||
@@ -211,11 +210,10 @@ int main(void)
|
|||||||
state = state_next;
|
state = state_next;
|
||||||
}
|
}
|
||||||
} while (!leave_loop);
|
} while (!leave_loop);
|
||||||
|
|
||||||
uart_puts("Exit bootloader!\n\n");
|
uart_puts("Exit bootloader!\n\n");
|
||||||
|
bootloader_exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
bootloader_exit();
|
|
||||||
|
|
||||||
/* Return to address 0x0000 */
|
/* Return to address 0x0000 */
|
||||||
startApplication();
|
startApplication();
|
||||||
|
|||||||
Reference in New Issue
Block a user