- make bootloader silent if not selected
git-svn-id: http://moon:8086/svn/projects/HendiControl@156 fda53097-d464-4ada-af97-ba876c37ca34
This commit is contained in:
@@ -58,14 +58,30 @@ void init_page(uint8_t *pPageBuffer, size_t size)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int port_init()
|
void port_init()
|
||||||
{
|
{
|
||||||
DDRB = 0x00;
|
DDRB = 0x00;
|
||||||
DDRD = 0x40;
|
DDRD = 0x40;
|
||||||
PORTD = 0x00;
|
PORTD = 0x40;
|
||||||
|
}
|
||||||
|
|
||||||
|
int is_bsel()
|
||||||
|
{
|
||||||
return ((PINB & 1) == 0);
|
return ((PINB & 1) == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void led_bsel(int enable)
|
||||||
|
{
|
||||||
|
if (enable)
|
||||||
|
{
|
||||||
|
PORTD = 0x00;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
PORTD = 0x40;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
uint8_t page_buffer[SPM_PAGESIZE];
|
uint8_t page_buffer[SPM_PAGESIZE];
|
||||||
@@ -73,15 +89,15 @@ int main(void)
|
|||||||
State state = StateIdle;
|
State state = StateIdle;
|
||||||
State state_next;
|
State state_next;
|
||||||
srec_t srec;
|
srec_t srec;
|
||||||
|
port_init();
|
||||||
|
|
||||||
cli();
|
cli();
|
||||||
|
if (is_bsel())
|
||||||
uart_init(9600);
|
|
||||||
uart_puts("Hendi-Control Bootloader v1.1\n");
|
|
||||||
|
|
||||||
int bsel = port_init();
|
|
||||||
if (bsel)
|
|
||||||
{
|
{
|
||||||
bootloader_enter();
|
bootloader_enter();
|
||||||
|
led_bsel(1);
|
||||||
|
uart_init(9600);
|
||||||
|
uart_puts("Hendi-Control Bootloader v1.2\n");
|
||||||
size_t image_size = 0;
|
size_t image_size = 0;
|
||||||
uint16_t page_addr = 0xFFFF;
|
uint16_t page_addr = 0xFFFF;
|
||||||
size_t hex_buffer_size = 0;
|
size_t hex_buffer_size = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user