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)); } } }
static void opt_lock(void) { deleteStr(); UIF_state = START; UIF_Init(); }
static void opt_lock(void){ deleteStr(); UIF_Init(); LedOff(); }