#include #include // Send ARM7 input information (X, Y, touch, lid) to ARM9 via FIFO. void vblank_handler(void) { inputGetAndSend(); } int main(void) { readUserSettings(); // Read user settings from firmware touchInit(); // Calibrate touch input from user settings irqInit(); // Initialise ARM7 interrupts fifoInit(); // Initialise FIFO system installSoundFIFO(); // Install FIFO handler for sound installSystemFIFO(); // Install FIFO handler for sleep mode initClockIRQTimer(0); // Read RTC then update seconds with timer 0 // TODO: Consider writing a custom system FIFO handler to deal with // the white screen flash when resuming from sleep. // Start sending input data to ARM9 on vblank. irqSet(IRQ_VBLANK, vblank_handler); irqEnable(IRQ_VBLANK); while (1) { swiWaitForVBlank(); } return 0; }