示例#1
0
文件: main.c 项目: godzivan/memtype
int main(void){
    //cli(); /* Ensure usb interrupts enabled by bootloader alter disconnect of usb */
    wdt_enable(WDTO_1S);
    SCH_Init();
    ADM_Init();
    UIB_Init();
    UIF_Init();
    LED_Init();
    CRD_Init();
    UCP_Init();
    OSCCAL_Init();

    /* USB Init */
    usbInit();
    usbDeviceDisconnect();  /* enforce re-enumeration, do this while interrupts are disabled! */
    _delay_ms(500);
    usbDeviceConnect();

    sei();


    /* 1 - Keyboard report id
       2 - HID feature report id
       reportBuffer is only used to send keyboard data so, initialize to 1
     */
    reportBuffer.reportid = 1;

    for(;; ) {                /* main event loop */
        wdt_reset();
        usbPoll();
        ADM_Task();
        SCH_Task();

        if(usbInterruptIsReady()) {
            UCP_WriteTask();
            LED_Task();
            printUpdate();
            usbSetInterrupt((void*)&reportBuffer, sizeof(reportBuffer));
        }
    }
}
示例#2
0
static void opt_lock(void)
{
    deleteStr();
    UIF_state = START;
    UIF_Init();
}
示例#3
0
文件: opt.c 项目: jim17/memtype
static void opt_lock(void){
    deleteStr();
    UIF_Init();
    LedOff();
}