summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoy Cho <joy.cho@hardkernel.com>2020-12-03 10:00:49 +0300
committerJoy Cho <joy.cho@hardkernel.com>2020-12-04 04:42:17 +0300
commit3113f3c523493f65824c543d024d489ab20b890b (patch)
tree5dddcde1bd32c103c6c040766c093fe12391d2ef
parent2e487eea926108a3dde9f2f3942aff1ecedd395c (diff)
downloadu-boot-3113f3c523493f65824c543d024d489ab20b890b.tar.xz
cmd: odroidtest: Adjust adc offsets and polling time
Change-Id: I2b36a22b9d00401decb63253a55c225ca0a7575f
-rw-r--r--cmd/odroidtest.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/cmd/odroidtest.c b/cmd/odroidtest.c
index 038f2e172a..a7f1021407 100644
--- a/cmd/odroidtest.c
+++ b/cmd/odroidtest.c
@@ -295,7 +295,8 @@ int adc_read_value(struct key_adc *adc, int adc_ch)
return CMD_RET_SUCCESS;
}
-#define ADC_CHECK_OFFSET 100
+#define ADC_CHECK_OFFSET_GO2 100
+#define ADC_CHECK_OFFSET_GO3 200
static int do_odroidtest_adc(cmd_tbl_t * cmdtp, int flag,
int argc, char * const argv[])
{
@@ -414,22 +415,22 @@ static int do_odroidtest_adc(cmd_tbl_t * cmdtp, int flag,
val_x, val_y);
/* WEST */
- if (val_x < center_x - ADC_CHECK_OFFSET) {
+ if (val_x < center_x - ADC_CHECK_OFFSET_GO3) {
if (!adckeys[0].chk)
adckeys[0].chk = 1;
key_idx = 0;
/* EAST */
- } else if (val_x > center_x + ADC_CHECK_OFFSET) {
+ } else if (val_x > center_x + ADC_CHECK_OFFSET_GO3) {
if (!adckeys[1].chk)
adckeys[1].chk = 1;
key_idx = 1;
/* NORTH */
- } else if (val_y < center_y - ADC_CHECK_OFFSET) {
+ } else if (val_y < center_y - ADC_CHECK_OFFSET_GO3) {
if (!adckeys[2].chk)
adckeys[2].chk = 1;
key_idx = 2;
/* SOUTH */
- } else if (val_y > center_y + ADC_CHECK_OFFSET) {
+ } else if (val_y > center_y + ADC_CHECK_OFFSET_GO3) {
if (!adckeys[3].chk)
adckeys[3].chk = 1;
key_idx = 3;
@@ -451,22 +452,22 @@ static int do_odroidtest_adc(cmd_tbl_t * cmdtp, int flag,
val_x, val_y);
/* WEST */
- if (val_x < center_x - ADC_CHECK_OFFSET) {
+ if (val_x < center_x - ADC_CHECK_OFFSET_GO3) {
if (!adckeys[4].chk)
adckeys[4].chk = 1;
key_idx = 4;
/* EAST */
- } else if (val_x > center_x + ADC_CHECK_OFFSET) {
+ } else if (val_x > center_x + ADC_CHECK_OFFSET_GO3) {
if (!adckeys[5].chk)
adckeys[5].chk = 1;
key_idx = 5;
/* NORTH */
- } else if (val_y < center_y - ADC_CHECK_OFFSET) {
+ } else if (val_y < center_y - ADC_CHECK_OFFSET_GO3) {
if (!adckeys[6].chk)
adckeys[6].chk = 1;
key_idx = 6;
/* SOUTH */
- } else if (val_y > center_y + ADC_CHECK_OFFSET) {
+ } else if (val_y > center_y + ADC_CHECK_OFFSET_GO3) {
if (!adckeys[7].chk)
adckeys[7].chk = 1;
key_idx = 7;
@@ -488,22 +489,22 @@ static int do_odroidtest_adc(cmd_tbl_t * cmdtp, int flag,
val_x, val_y);
/* WEST : plus value */
- if (val_x > center_x + ADC_CHECK_OFFSET) {
+ if (val_x > center_x + ADC_CHECK_OFFSET_GO2) {
if (!adckeys[0].chk)
adckeys[0].chk = 1;
key_idx = 0;
/* EAST : minus value */
- } else if (val_x < center_x - ADC_CHECK_OFFSET) {
+ } else if (val_x < center_x - ADC_CHECK_OFFSET_GO2) {
if (!adckeys[1].chk)
adckeys[1].chk = 1;
key_idx = 1;
/* NORTH : minus value */
- } else if (val_y < center_y - ADC_CHECK_OFFSET) {
+ } else if (val_y < center_y - ADC_CHECK_OFFSET_GO2) {
if (!adckeys[2].chk)
adckeys[2].chk = 1;
key_idx = 2;
/* SOUTH : plus value */
- } else if (val_y > center_y + ADC_CHECK_OFFSET) {
+ } else if (val_y > center_y + ADC_CHECK_OFFSET_GO2) {
if (!adckeys[3].chk)
adckeys[3].chk = 1;
key_idx = 3;
@@ -512,9 +513,9 @@ static int do_odroidtest_adc(cmd_tbl_t * cmdtp, int flag,
adc_draw_key_arrays(adcs, key_idx);
key_idx = -1;
- mdelay(200);
+ mdelay(80);
- /* termination using F3+F6 */
+ /* check termination keys */
key = wait_key_event(true);
if (check_termination_key(key))
break;