summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2016-10-26 20:40:53 +0200
committerAmaury Pouly <amaury.pouly@gmail.com>2016-10-26 20:46:57 +0200
commit794104dd17a28a2db09ca1ed44ba7dfb18a1f0ca (patch)
treea872c56f765c61623a6ddf90914f0d1647b70bf7
parentd42b43c7860aacafbce97cccb3b2f19ad8812d56 (diff)
downloadrockbox-794104d.tar.gz
rockbox-794104d.tar.bz2
rockbox-794104d.zip
nwztools/plattools: switch to BACK key to quit
The power off/option does not exist on some models. Change-Id: Ifb45293b3b3faa96d9fece2340cbd98299a4a0b7
-rw-r--r--utils/nwztools/plattools/test_adc.c4
-rw-r--r--utils/nwztools/plattools/test_bl.c16
-rw-r--r--utils/nwztools/plattools/test_keys.c16
-rw-r--r--utils/nwztools/plattools/test_power.c4
-rw-r--r--utils/nwztools/plattools/test_ts.c4
5 files changed, 22 insertions, 22 deletions
diff --git a/utils/nwztools/plattools/test_adc.c b/utils/nwztools/plattools/test_adc.c
index 52c0bffe1b..a0b12f55cc 100644
--- a/utils/nwztools/plattools/test_adc.c
+++ b/utils/nwztools/plattools/test_adc.c
@@ -24,7 +24,7 @@ int main(int argc, char **argv)
{
/* clear screen and display welcome message */
nwz_lcdmsg(true, 0, 0, "test_adc");
- nwz_lcdmsg(false, 0, 2, "PWR OFF: quit");
+ nwz_lcdmsg(false, 0, 2, "BACK: quit");
/* open input device */
int input_fd = nwz_key_open();
if(input_fd < 0)
@@ -55,7 +55,7 @@ int main(int argc, char **argv)
struct input_event evt;
if(nwz_key_read_event(input_fd, &evt) != 1)
continue;
- if(nwz_key_event_get_keycode(&evt) == NWZ_KEY_OPTION && !nwz_key_event_is_press(&evt))
+ if(nwz_key_event_get_keycode(&evt) == NWZ_KEY_BACK && !nwz_key_event_is_press(&evt))
break;
}
/* finish nicely */
diff --git a/utils/nwztools/plattools/test_bl.c b/utils/nwztools/plattools/test_bl.c
index b70f81b957..f97162fc4f 100644
--- a/utils/nwztools/plattools/test_bl.c
+++ b/utils/nwztools/plattools/test_bl.c
@@ -24,10 +24,10 @@ int main(int argc, char **argv)
{
/* clear screen and display welcome message */
nwz_lcdmsg(true, 0, 0, "test_bl");
- nwz_lcdmsg(false, 0, 2, "UP/DOWN: level");
- nwz_lcdmsg(false, 0, 3, "LEFT/RIGHT: step");
+ nwz_lcdmsg(false, 0, 2, "LEFT/RIGHT: level");
+ nwz_lcdmsg(false, 0, 3, "UP/DOWN: step");
nwz_lcdmsg(false, 0, 4, "VOL UP/DOWN: period");
- nwz_lcdmsg(false, 0, 5, "PWR OFF: quit");
+ nwz_lcdmsg(false, 0, 5, "BACK: quit");
/* open input and framebuffer device */
int input_fd = nwz_key_open();
if(input_fd < 0)
@@ -65,25 +65,25 @@ int main(int argc, char **argv)
/* only act on release */
if(press)
continue;
- if(code == NWZ_KEY_OPTION)
+ if(code == NWZ_KEY_BACK)
break; /* quit */
bool change_bl = false;
- if(code == NWZ_KEY_UP && bl.level < NWZ_FB_BL_MAX_LEVEL)
+ if(code == NWZ_KEY_RIGHT && bl.level < NWZ_FB_BL_MAX_LEVEL)
{
change_bl = true;
bl.level++;
}
- else if(code == NWZ_KEY_DOWN && bl.level > NWZ_FB_BL_MIN_LEVEL)
+ else if(code == NWZ_KEY_LEFT && bl.level > NWZ_FB_BL_MIN_LEVEL)
{
change_bl = true;
bl.level--;
}
- else if(code == NWZ_KEY_RIGHT && bl.step < NWZ_FB_BL_MAX_STEP)
+ else if(code == NWZ_KEY_UP && bl.step < NWZ_FB_BL_MAX_STEP)
{
change_bl = true;
bl.step++;
}
- else if(code == NWZ_KEY_LEFT && bl.step > NWZ_FB_BL_MIN_STEP)
+ else if(code == NWZ_KEY_DOWN && bl.step > NWZ_FB_BL_MIN_STEP)
{
change_bl = true;
bl.step--;
diff --git a/utils/nwztools/plattools/test_keys.c b/utils/nwztools/plattools/test_keys.c
index 3640e007fc..bfeadbb42b 100644
--- a/utils/nwztools/plattools/test_keys.c
+++ b/utils/nwztools/plattools/test_keys.c
@@ -24,7 +24,7 @@ int main(int argc, char **argv)
{
/* clear screen and display welcome message */
nwz_lcdmsg(true, 0, 0, "test_keys");
- nwz_lcdmsg(false, 0, 2, "hold PWR OFF for 3 seconds to quit");
+ nwz_lcdmsg(false, 0, 2, "hold BACK for 3 seconds to quit");
/* open input device */
int input_fd = nwz_key_open();
if(input_fd < 0)
@@ -34,7 +34,7 @@ int main(int argc, char **argv)
return 1;
}
/* display input state in a loop */
- int pwr_off_pressed = 0; /* 0 = no pressed, >0 = number of seconds pressed - 1 */
+ int back_pressed = 0; /* 0 = no pressed, >0 = number of seconds pressed - 1 */
while(1)
{
/* display HOLD status */
@@ -43,9 +43,9 @@ int main(int argc, char **argv)
int ret = nwz_key_wait_event(input_fd, 1000000);
if(ret != 1)
{
- if(pwr_off_pressed > 0)
- pwr_off_pressed++;
- if(pwr_off_pressed >= 4)
+ if(back_pressed > 0)
+ back_pressed++;
+ if(back_pressed >= 4)
break;
continue;
}
@@ -56,10 +56,10 @@ int main(int argc, char **argv)
nwz_key_get_name(nwz_key_event_get_keycode(&evt)),
nwz_key_event_is_press(&evt) ? "pressed" : "released",
nwz_key_event_get_hold_status(&evt));
- if(nwz_key_event_get_keycode(&evt) == NWZ_KEY_OPTION && nwz_key_event_is_press(&evt))
- pwr_off_pressed = 1;
+ if(nwz_key_event_get_keycode(&evt) == NWZ_KEY_BACK && nwz_key_event_is_press(&evt))
+ back_pressed = 1;
else
- pwr_off_pressed = 0;
+ back_pressed = 0;
}
/* close input device */
close(input_fd);
diff --git a/utils/nwztools/plattools/test_power.c b/utils/nwztools/plattools/test_power.c
index c02f689b17..9c429b989a 100644
--- a/utils/nwztools/plattools/test_power.c
+++ b/utils/nwztools/plattools/test_power.c
@@ -63,7 +63,7 @@ int main(int argc, char **argv)
{
/* clear screen and display welcome message */
nwz_lcdmsg(true, 0, 0, "test_power");
- nwz_lcdmsg(false, 0, 2, "PWR OFF: quit");
+ nwz_lcdmsg(false, 0, 2, "BACK: quit");
/* open input device */
int input_fd = nwz_key_open();
if(input_fd < 0)
@@ -126,7 +126,7 @@ int main(int argc, char **argv)
struct input_event evt;
if(nwz_key_read_event(input_fd, &evt) != 1)
continue;
- if(nwz_key_event_get_keycode(&evt) == NWZ_KEY_OPTION && !nwz_key_event_is_press(&evt))
+ if(nwz_key_event_get_keycode(&evt) == NWZ_KEY_BACK && !nwz_key_event_is_press(&evt))
break;
}
/* finish nicely */
diff --git a/utils/nwztools/plattools/test_ts.c b/utils/nwztools/plattools/test_ts.c
index 73e729a093..af6c741e00 100644
--- a/utils/nwztools/plattools/test_ts.c
+++ b/utils/nwztools/plattools/test_ts.c
@@ -24,7 +24,7 @@ int main(int argc, char **argv)
{
/* clear screen and display welcome message */
nwz_lcdmsg(true, 0, 0, "test_ts");
- nwz_lcdmsg(false, 0, 2, "PWR OFF: quit");
+ nwz_lcdmsg(false, 0, 2, "BACK: quit");
/* open input device */
int key_fd = nwz_key_open();
if(key_fd < 0)
@@ -61,7 +61,7 @@ int main(int argc, char **argv)
struct input_event evt;
if(nwz_key_read_event(key_fd, &evt) == 1)
{
- if(nwz_key_event_get_keycode(&evt) == NWZ_KEY_OPTION &&
+ if(nwz_key_event_get_keycode(&evt) == NWZ_KEY_BACK &&
nwz_key_event_is_press(&evt))
break; /* quit */
}