Functions

projects/nrfgo_sdk/bootloader_32k/firmware/bootloader.h File Reference

Go to the source code of this file.

Functions

void bootloader (void)

Detailed Description

Header file for bootloader.c

Definition in file bootloader.h.


Function Documentation

void bootloader ( void   )

Definition at line 172 of file bootloader.c.

{
    EA = 0;
    get_used_flash_pages();
    usb_init();
    CKCON = 0x02;       // See nRF24LU1p AX PAN
    nblock = 0;
    packet_received = page_write = false;
    //
    // Enter an infinite loop waiting checking the USB interrupt flag and
    // call the interrupt handler, usb_irq, when the flag is set. The interrupt
    // handler will set the variable packet_received to true when a packet is
    // received.     
    for(;;)
    {
        if (USBF)
        {
            USBF = 0;
            usb_irq();
            if(packet_received)
            {
                parse_commands();
                packet_received = false;
            }
        }
    }
}