s32 SEQ_TERMINAL_PrintSystem(void *_output_function) { void (*out)(char *format, ...) = _output_function; char str_buffer[128]; MUTEX_MIDIOUT_TAKE; out("System Informations:\n"); out("====================\n"); out(MIOS32_LCD_BOOT_MSG_LINE1 " " MIOS32_LCD_BOOT_MSG_LINE2 "\n"); mios32_sys_time_t t = MIOS32_SYS_TimeGet(); int hours = (t.seconds / 3600) % 24; int minutes = (t.seconds % 3600) / 60; int seconds = (t.seconds % 3600) % 60; out("Operating System: MIOS32\n"); out("Board: " MIOS32_BOARD_STR "\n"); out("Chip Family: " MIOS32_FAMILY_STR "\n"); if( MIOS32_SYS_SerialNumberGet((char *)str_buffer) >= 0 ) out("Serial Number: %s\n", str_buffer); else out("Serial Number: ?\n"); out("Flash Memory Size: %d bytes\n", MIOS32_SYS_FlashSizeGet()); out("RAM Size: %d bytes\n", MIOS32_SYS_RAMSizeGet()); out("Systime: %02d:%02d:%02d\n", hours, minutes, seconds); out("CPU Load: %02d%%\n", SEQ_STATISTICS_CurrentCPULoad()); out("MIDI Scheduler: Alloc %3d/%3d Drops: %3d", seq_midi_out_allocated, seq_midi_out_max_allocated, seq_midi_out_dropouts); u32 stopwatch_value_max = SEQ_STATISTICS_StopwatchGetValueMax(); u32 stopwatch_value = SEQ_STATISTICS_StopwatchGetValue(); if( stopwatch_value_max == 0xffffffff ) { out("Stopwatch: Overrun!\n"); } else if( !stopwatch_value_max ) { out("Stopwatch: no result yet\n"); } else { out("Stopwatch: %d/%d uS\n", stopwatch_value, stopwatch_value_max); } #if !defined(MIOS32_FAMILY_EMULATION) && configGENERATE_RUN_TIME_STATS // send Run Time Stats to MIOS terminal out("FreeRTOS Task RunTime Stats:\n"); FREERTOS_UTILS_RunTimeStats(); #endif out("done.\n"); MUTEX_MIDIOUT_GIVE; return 0; // no error }
///////////////////////////////////////////////////////////////////////////// // Local Display Handler function // IN: <high_prio>: if set, a high-priority LCD update is requested ///////////////////////////////////////////////////////////////////////////// static s32 LCD_Handler(u8 high_prio) { if( high_prio ) { SEQ_LCD_CursorSet(32, 0); mios32_sys_time_t t = MIOS32_SYS_TimeGet(); int hours = (t.seconds / 3600) % 24; int minutes = (t.seconds % 3600) / 60; int seconds = (t.seconds % 3600) % 60; SEQ_LCD_PrintFormattedString("%02d:%02d:%02d", hours, minutes, seconds); return 0; } // layout: // 00000000001111111111222222222233333333330000000000111111111122222222223333333333 // 01234567890123456789012345678901234567890123456789012345678901234567890123456789 // <--------------------------------------><--------------------------------------> // About this MIDIbox: 00:00:00Stopwatch: 100/ 300 uS CPU Load: 40% // System Globals Tracks TrackInfo>MIDI Scheduler: Alloc 0/ 0 Drops: 0 // Select MIDI Device with GP Button: 10 Devices found under /sysex // xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx> /////////////////////////////////////////////////////////////////////////// SEQ_LCD_CursorSet(0, 0); SEQ_LCD_PrintString("About this MIDIbox: "); /////////////////////////////////////////////////////////////////////////// SEQ_LCD_CursorSet(0, 1); SEQ_LCD_PrintList((char *)ui_global_dir_list, LIST_ENTRY_WIDTH, NUM_LIST_ITEMS, NUM_LIST_DISPLAYED_ITEMS, ui_selected_item, list_view_offset); /////////////////////////////////////////////////////////////////////////// switch( ui_selected_item + list_view_offset ) { case LIST_ITEM_SYSTEM: { u32 stopwatch_value_max = SEQ_STATISTICS_StopwatchGetValueMax(); u32 stopwatch_value = SEQ_STATISTICS_StopwatchGetValue(); SEQ_LCD_CursorSet(40, 0); if( stopwatch_value_max == 0xffffffff ) { SEQ_LCD_PrintFormattedString("Stopwatch: Overrun! "); } else if( !stopwatch_value_max ) { SEQ_LCD_PrintFormattedString("Stopwatch: no result yet"); } else { SEQ_LCD_PrintFormattedString("Stopwatch: %4d/%4d uS ", stopwatch_value, stopwatch_value_max); } SEQ_LCD_PrintSpaces(3); SEQ_LCD_PrintFormattedString("CPU Load: %02d%%", SEQ_STATISTICS_CurrentCPULoad()); SEQ_LCD_CursorSet(40, 1); if( seq_midi_out_allocated > 1000 || seq_midi_out_max_allocated > 1000 || seq_midi_out_dropouts > 1000 ) { SEQ_LCD_PrintFormattedString("MIDI Scheduler: Alloc %4d/%4d Dr: %4d", seq_midi_out_allocated, seq_midi_out_max_allocated, seq_midi_out_dropouts); } else { SEQ_LCD_PrintFormattedString("MIDI Scheduler: Alloc %3d/%3d Drops: %3d", seq_midi_out_allocated, seq_midi_out_max_allocated, seq_midi_out_dropouts); } } break; default: SEQ_LCD_CursorSet(40, 0); // <----------------------------------------> SEQ_LCD_PrintString("Press SELECT to send Informations "); SEQ_LCD_CursorSet(40, 1); SEQ_LCD_PrintString("to MIOS Terminal "); } return 0; // no error }