Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[wiki] add testing functions to wiki

To display the base version and be able to clear the history via the
serial port

Signed-off-by: Christopher Hall <hsw@openmoko.com>
  • Loading branch information...
commit 728c138c77f95b193af829924736f3b09274696b 1 parent 59da482
@hxw hxw authored
Showing with 27 additions and 0 deletions.
  1. +18 −0 wiki/wiki.c
  2. +9 −0 wiki/wikilib.c
View
18 wiki/wiki.c
@@ -3,6 +3,7 @@
*
* Authors Daniel Mack <daniel@caiaq.de>
* Holger Hans Peter Freyther <zecke@openmoko.org>
+ * Christopher Hall <hsw@openmoko.org>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -34,6 +35,23 @@ int grifo_main(int argc, char **argv)
(void)argv; // *** unused argument
debug_printf("starting wiki app\n");
+
+ int fd = file_open("version.txt", FILE_OPEN_READ);
+ if (fd >= 0) {
+ debug_print("Display version.txt\n");
+ for (;;) {
+ char c;
+ size_t len = file_read(fd, &c, 1);
+ if (len <= 0) {
+ break;
+ }
+ debug_print_char(c);
+ }
+ file_close(fd);
+ } else {
+ debug_print("Missing version.txt\n");
+ }
+
wikilib_run();
return 1;
}
View
9 wiki/wikilib.c
@@ -1371,6 +1371,15 @@ int wikilib_run(void)
event_get(&ev);
more_events = 1;
switch (ev.item_type) {
+ case EVENT_KEY:
+ if (display_mode == DISPLAY_MODE_HISTORY
+ && (ev.key.code == 'y' || ev.key.code == 'Y')) {
+ history_clear();
+ keyboard_set_mode(KEYBOARD_NONE);
+ history_reload();
+ debug_print("History Cleared\n");
+ }
+ break;
case EVENT_BUTTON_UP:
b_show_scroll_bar = 0;
handle_button_release(ev.button.code);
Please sign in to comment.
Something went wrong with that request. Please try again.