///////////////////////////////////////////////////////////////////////////// // This hook is called after startup to initialize the application ///////////////////////////////////////////////////////////////////////////// extern "C" void APP_Init(void) { // initialize all LEDs MIOS32_BOARD_LED_Init(0xffffffff); // initialize AOUT driver AOUT_Init(0); // initialize SID module SID_Init(0); // start tasks (differs between MIOS32 and MacOS) TASKS_Init(0); // install MIDI Rx/Tx callback functions MIOS32_MIDI_DirectRxCallback_Init((void *)&NOTIFY_MIDI_Rx); MIOS32_MIDI_DirectTxCallback_Init((void *)&NOTIFY_MIDI_Tx); // install MIDI SysEx callback function MIOS32_MIDI_SysExCallback_Init((void *)&NOTIFY_MIDI_SysEx); // install timeout callback function MIOS32_MIDI_TimeOutCallback_Init((void *)&NOTIFY_MIDI_TimeOut); // init Stopwatch APP_StopwatchInit(); // init MBNet MBNET_Init(0); MBNET_NodeIDSet(0x10); // initialize MbSidEnvironment sid_se_speed_factor = 2; mbSidEnvironment.updateSpeedFactorSet(sid_se_speed_factor); // start timer // TODO: increase once performance has been evaluated MIOS32_TIMER_Init(2, 2000 / sid_se_speed_factor, (void *)&SID_TIMER_SE_Update, MIOS32_IRQ_PRIO_MID); }
///////////////////////////////////////////////////////////////////////////// // This hook is called after startup to initialize the application ///////////////////////////////////////////////////////////////////////////// void APP_Init(void) { // initialize all LEDs MIOS32_BOARD_LED_Init(0xffffffff); // disable DIN test mode by default app_din_testmode = 0; #ifdef MBSEQV4L // MBSEQV4L: set default port to 0xc0: multiple outputs MIOS32_MIDI_DefaultPortSet(0xc0); #endif // initialize hardware soft-config SEQ_HWCFG_Init(0); #ifndef MBSEQV4L // initialize CLCDs SEQ_LCD_Init(0); #endif // init BLMs #ifndef MBSEQV4L BLM_Init(0); #else BLM_CHEAPO_Init(0); #endif BLM_X_Init(); SEQ_TPD_Init(0); // initialize CV SEQ_CV_Init(0); // initialize MIDI handlers SEQ_MIDI_PORT_Init(0); SEQ_MIDI_IN_Init(0); SEQ_MIDI_SYSEX_Init(0); SEQ_BLM_Init(0); SEQ_MIDI_OUT_Init(0); SEQ_MIDI_ROUTER_Init(0); SEQ_TERMINAL_Init(0); // init mixer page SEQ_MIXER_Init(0); // init sequencer core SEQ_CORE_Init(0); // init user interface #ifndef MBSEQV4L SEQ_LABEL_Init(0); SEQ_CC_LABELS_Init(0); #endif SEQ_LED_Init(0); SEQ_UI_Init(0); // initial load of filesystem SEQ_FILE_Init(0); // start tasks (differs between MIOS32 and MacOS) TASKS_Init(0); // install MIDI Rx/Tx callback functions MIOS32_MIDI_DirectRxCallback_Init(&NOTIFY_MIDI_Rx); MIOS32_MIDI_DirectTxCallback_Init(&NOTIFY_MIDI_Tx); // install SysEx callback MIOS32_MIDI_SysExCallback_Init(APP_SYSEX_Parser); // install timeout callback function MIOS32_MIDI_TimeOutCallback_Init(&NOTIFY_MIDI_TimeOut); }