diff options
Diffstat (limited to 'apps/debug_menu.c')
-rw-r--r-- | apps/debug_menu.c | 59 |
1 files changed, 12 insertions, 47 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c index 397a853857..b654bb6dcc 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c | |||
@@ -180,23 +180,18 @@ static int dbg_threads_action_callback(int action, struct gui_synclist *lists) | |||
180 | static bool dbg_os(void) | 180 | static bool dbg_os(void) |
181 | { | 181 | { |
182 | struct simplelist_info info; | 182 | struct simplelist_info info; |
183 | info.title = IF_COP("Core and ") "Stack usage:"; | 183 | simplelist_info_init(&info, IF_COP("Core and ") "Stack usage:", 1, |
184 | #if NUM_CORES == 1 | 184 | #if NUM_CORES == 1 |
185 | info.count = MAXTHREADS; | 185 | MAXTHREADS, |
186 | #else | 186 | #else |
187 | info.count = MAXTHREADS+NUM_CORES; | 187 | MAXTHREADS+NUM_CORES, |
188 | #endif | 188 | #endif |
189 | info.selection_size = 1; | 189 | NULL); |
190 | #ifdef ROCKBOX_HAS_LOGF | 190 | #ifndef ROCKBOX_HAS_LOGF |
191 | info.hide_selection = false; | ||
192 | #else | ||
193 | info.hide_selection = true; | 191 | info.hide_selection = true; |
194 | #endif | 192 | #endif |
195 | info.scroll_all = false; | ||
196 | info.action_callback = dbg_threads_action_callback; | 193 | info.action_callback = dbg_threads_action_callback; |
197 | info.get_icon = NULL; | ||
198 | info.get_name = threads_getname; | 194 | info.get_name = threads_getname; |
199 | info.callback_data = NULL; | ||
200 | return simplelist_show_list(&info); | 195 | return simplelist_show_list(&info); |
201 | } | 196 | } |
202 | 197 | ||
@@ -736,15 +731,9 @@ static char* dbg_partitions_getname(int selected_item, void * data, char *buffer | |||
736 | bool dbg_partitions(void) | 731 | bool dbg_partitions(void) |
737 | { | 732 | { |
738 | struct simplelist_info info; | 733 | struct simplelist_info info; |
739 | info.title = "Partition Info"; | 734 | simplelist_info_init(&info, "Partition Info", 2, 4, NULL); |
740 | info.count = 4; | ||
741 | info.selection_size = 2; | ||
742 | info.hide_selection = true; | 735 | info.hide_selection = true; |
743 | info.scroll_all = false; | ||
744 | info.action_callback = NULL; | ||
745 | info.get_icon = NULL; | ||
746 | info.get_name = dbg_partitions_getname; | 736 | info.get_name = dbg_partitions_getname; |
747 | info.callback_data = NULL; | ||
748 | return simplelist_show_list(&info); | 737 | return simplelist_show_list(&info); |
749 | } | 738 | } |
750 | #endif | 739 | #endif |
@@ -1794,22 +1783,15 @@ static int disk_callback(int btn, struct gui_synclist *lists) | |||
1794 | static bool dbg_disk_info(void) | 1783 | static bool dbg_disk_info(void) |
1795 | { | 1784 | { |
1796 | struct simplelist_info info; | 1785 | struct simplelist_info info; |
1786 | simplelist_info_init(&info, "Disk Info", 1,1, NULL); | ||
1797 | #if defined(HAVE_MMC) || defined(HAVE_HOTSWAP) | 1787 | #if defined(HAVE_MMC) || defined(HAVE_HOTSWAP) |
1798 | char title[16]; | 1788 | char title[16]; |
1799 | int card = 0; | 1789 | int card = 0; |
1800 | info.callback_data = (void*)&card; | 1790 | info.callback_data = (void*)&card; |
1801 | info.title = title; | 1791 | info.title = title; |
1802 | #else | ||
1803 | info.callback_data = NULL; | ||
1804 | info.title = "Disk Info"; | ||
1805 | #endif | 1792 | #endif |
1806 | info.count = 1; | ||
1807 | info.selection_size = 1; | ||
1808 | info.action_callback = disk_callback; | 1793 | info.action_callback = disk_callback; |
1809 | info.hide_selection = true; | 1794 | info.hide_selection = true; |
1810 | info.scroll_all = false; | ||
1811 | info.get_icon = NULL; | ||
1812 | info.get_name = NULL; | ||
1813 | return simplelist_show_list(&info); | 1795 | return simplelist_show_list(&info); |
1814 | } | 1796 | } |
1815 | #endif /* !SIMULATOR */ | 1797 | #endif /* !SIMULATOR */ |
@@ -1839,15 +1821,9 @@ static int dircache_callback(int btn, struct gui_synclist *lists) | |||
1839 | static bool dbg_dircache_info(void) | 1821 | static bool dbg_dircache_info(void) |
1840 | { | 1822 | { |
1841 | struct simplelist_info info; | 1823 | struct simplelist_info info; |
1842 | info.title = "Dircache Info"; | 1824 | simplelist_info_init(&info, "Dircache Info", 1, 7, NULL); |
1843 | info.count = 7; | ||
1844 | info.selection_size = 1; | ||
1845 | info.action_callback = dircache_callback; | 1825 | info.action_callback = dircache_callback; |
1846 | info.hide_selection = true; | 1826 | info.hide_selection = true; |
1847 | info.scroll_all = false; | ||
1848 | info.get_icon = NULL; | ||
1849 | info.get_name = NULL; | ||
1850 | info.callback_data = NULL; | ||
1851 | return simplelist_show_list(&info); | 1827 | return simplelist_show_list(&info); |
1852 | } | 1828 | } |
1853 | 1829 | ||
@@ -1878,15 +1854,9 @@ static int database_callback(int btn, struct gui_synclist *lists) | |||
1878 | static bool dbg_tagcache_info(void) | 1854 | static bool dbg_tagcache_info(void) |
1879 | { | 1855 | { |
1880 | struct simplelist_info info; | 1856 | struct simplelist_info info; |
1881 | info.title = "Database Info"; | 1857 | simplelist_info_init(&info, "Database Info", 1, 7, NULL); |
1882 | info.count = 7; | ||
1883 | info.selection_size = 1; | ||
1884 | info.action_callback = database_callback; | 1858 | info.action_callback = database_callback; |
1885 | info.hide_selection = true; | 1859 | info.hide_selection = true; |
1886 | info.scroll_all = false; | ||
1887 | info.get_icon = NULL; | ||
1888 | info.get_name = NULL; | ||
1889 | info.callback_data = NULL; | ||
1890 | return simplelist_show_list(&info); | 1860 | return simplelist_show_list(&info); |
1891 | } | 1861 | } |
1892 | #endif | 1862 | #endif |
@@ -2026,18 +1996,13 @@ static int radio_callback(int btn, struct gui_synclist *lists) | |||
2026 | static bool dbg_fm_radio(void) | 1996 | static bool dbg_fm_radio(void) |
2027 | { | 1997 | { |
2028 | struct simplelist_info info; | 1998 | struct simplelist_info info; |
1999 | simplelist_info_init(&info, "FM Radio", 1, 1, NULL); | ||
2029 | simplelist_set_line_count(0); | 2000 | simplelist_set_line_count(0); |
2030 | simplelist_addline(SIMPLELIST_ADD_LINE, "HW detected: %s", radio_hardware_present() ? "yes" : "no"); | 2001 | simplelist_addline(SIMPLELIST_ADD_LINE, "HW detected: %s", |
2002 | radio_hardware_present() ? "yes" : "no"); | ||
2031 | 2003 | ||
2032 | info.title = "FM Radio"; | ||
2033 | info.count = 1; | ||
2034 | info.selection_size = 1; | ||
2035 | info.action_callback = radio_hardware_present()?radio_callback : NULL; | 2004 | info.action_callback = radio_hardware_present()?radio_callback : NULL; |
2036 | info.hide_selection = true; | 2005 | info.hide_selection = true; |
2037 | info.scroll_all = false; | ||
2038 | info.get_icon = NULL; | ||
2039 | info.get_name = NULL; | ||
2040 | info.callback_data = NULL; | ||
2041 | return simplelist_show_list(&info); | 2006 | return simplelist_show_list(&info); |
2042 | } | 2007 | } |
2043 | #endif /* CONFIG_TUNER */ | 2008 | #endif /* CONFIG_TUNER */ |