gpio: add modify gpio function in powerdebug tool.
For power consumption test, we can change gpio direction and value
and check that power consumption is falled or not.
use 'D' key to change gpio direction.
And when gpio direction is "out", use 'V' key to change gpio value.
Signed-off-by: Shaojie Sun <shaojie.sun@linaro.com>
diff --git a/display.c b/display.c
index 41a511d..c0afe03 100644
--- a/display.c
+++ b/display.c
@@ -164,6 +164,17 @@
return 0;
}
+static int display_change(int keyvalue)
+{
+ if (!(windata[current_win].nrdata))
+ return 0;
+
+ if (windata[current_win].ops && windata[current_win].ops->change)
+ return windata[current_win].ops->change(keyvalue);
+
+ return 0;
+}
+
static int display_next_panel(void)
{
size_t array_size = sizeof(windata) / sizeof(windata[0]);
@@ -406,6 +417,13 @@
display_select();
break;
+ case 'v':
+ case 'V':
+ case 'd':
+ case 'D':
+ display_change(toupper(keystroke));
+ break;
+
case EOF:
case 'q':
case 'Q':