Changeset 589:6fed7fee381f
- Timestamp:
- 06/08/08 00:38:25 (7 months ago)
- Author:
- Maxime Petazzoni <maxime.petazzoni@…>
- Branch:
- default
- Message:
-
Add defrag and FS stats function for testing.
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r584
|
r589
|
|
| 27 | 27 | void record(char *filename); |
| 28 | 28 | void replay(char *filename); |
| | 29 | void defrag(void); |
| 29 | 30 | |
| 30 | 31 | void record(char *filename) { |
| … |
… |
|
| 82 | 83 | } |
| 83 | 84 | |
| | 85 | void defrag(void) { |
| | 86 | nx_display_clear(); |
| | 87 | nx_display_string("- Defrag -\n\n"); |
| | 88 | nx_fs_defrag_best_overall(); |
| | 89 | nx_display_string("Done.\n"); |
| | 90 | } |
| | 91 | |
| | 92 | void stats(void) { |
| | 93 | U32 files = 0, used = 0, free_pages = 0, wasted = 0; |
| | 94 | |
| | 95 | nx_display_clear(); |
| | 96 | nx_display_string("- FS stats -\n\n"); |
| | 97 | |
| | 98 | nx_fs_get_occupation(&files, &used, &free_pages, &wasted); |
| | 99 | |
| | 100 | nx_display_uint(files); |
| | 101 | nx_display_string(" file(s).\n"); |
| | 102 | |
| | 103 | nx_display_uint(used); |
| | 104 | nx_display_string("B used.\n"); |
| | 105 | |
| | 106 | nx_display_uint(free_pages); |
| | 107 | nx_display_string(" free page(s).\n"); |
| | 108 | |
| | 109 | nx_display_uint(wasted); |
| | 110 | nx_display_string("B wasted.\n"); |
| | 111 | } |
| | 112 | |
| 84 | 113 | void main(void) { |
| 85 | | char *entries[] = {"Replay", "Record", "--", "Halt", NULL}; |
| | 114 | char *entries[] = {"Replay", "Record", "Stats", "Defrag", "Halt", NULL}; |
| 86 | 115 | gui_text_menu_t menu; |
| 87 | 116 | U8 res; |
| … |
… |
|
| 105 | 134 | record(ROUTE_FILE); |
| 106 | 135 | break; |
| | 136 | case 2: |
| | 137 | stats(); |
| | 138 | break; |
| | 139 | case 3: |
| | 140 | defrag(); |
| | 141 | break; |
| 107 | 142 | default: |
| 108 | 143 | continue; |