static int iocBuild_2(void) { initHookAnnounce(initHookAfterCaLinkInit); initDrvSup(); initHookAnnounce(initHookAfterInitDrvSup); initRecSup(); initHookAnnounce(initHookAfterInitRecSup); initDevSup(); initHookAnnounce(initHookAfterInitDevSup); dbLockInitRecords(pdbbase); initDatabase(); dbBkptInit(); initHookAnnounce(initHookAfterInitDatabase); finishDevSup(); initHookAnnounce(initHookAfterFinishDevSup); scanInit(); if (asInit()) { errlogPrintf("iocBuild: asInit Failed.\n"); return -1; } dbProcessNotifyInit(); epicsThreadSleep(.5); initHookAnnounce(initHookAfterScanInit); initialProcess(); initHookAnnounce(initHookAfterInitialProcess); return 0; }
int main(void) { initHardware(); sei(); kbdInit(); scanInit(); layersInit(); macrosInit(); expLoad(); _delay_ms(5); scanEnable(); /* try loading vref from eeprom; if set to 0xffff, run calibration */ vrefLoad(); if (vrefGet() == 0xffff) kbdCalibrate(); for (;;) { /* try to keep updates synchronous; we don't want to update * bitmap if we haven't sent the last report yet. */ if (( usingNKROReport() && !updateNKROReport) || (!usingNKROReport() && !updateKeyboardReport)) { bool needsUpdate = false; needsUpdate |= kbdUpdateSCBmp(); needsUpdate |= macrosProcessScan(); needsUpdate |= expProcessScan(needsUpdate); if (needsUpdate) { updateKeyboardReport = true; updateNKROReport = true; updateSystemReport = true; updateConsumerReport = true; } layersProcessScan(); } if (USB_DeviceState == DEVICE_STATE_Unattached || USB_DeviceState == DEVICE_STATE_Suspended) if (USB_Device_RemoteWakeupEnabled && kbdWantsWakeup()) USB_Device_SendRemoteWakeup(); HID_Device_USBTask(&keyboardHIDIface); HID_Device_USBTask(&genericHIDIface); HID_Device_USBTask(&nkroHIDIface); HID_Device_USBTask(&extrakeyHIDIface); USB_USBTask(); } }