From: Grazvydas Ignotas Date: Sat, 28 Apr 2012 00:01:09 +0000 (+0300) Subject: op_test_inputs: handle mode change race X-Git-Tag: sz_beta4^0 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b82c7b89a10b8f1f39244f947f5036eb25a39342;p=pandora-misc.git op_test_inputs: handle mode change race --- diff --git a/op_test_inputs.c b/op_test_inputs.c index 8a1e471..a831a6a 100644 --- a/op_test_inputs.c +++ b/op_test_inputs.c @@ -500,10 +500,15 @@ int main(int argc, char *argv[]) if (ifd[DEV_PWRBTN] == -1) printf("Warning: couldn't find pwrbutton device\n"); if (ifd[DEV_KEYPAD] == -1) printf("Warning: couldn't find keypad device\n"); - if (ifd[DEV_BUTTONS] == -1) printf("Warning: couldn't find button device\n"); if (ifd[DEV_TS] == -1) printf("Warning: couldn't find touchscreen device\n"); if (ifd[DEV_LNUB] == -1) printf("Warning: couldn't find nub1 device\n"); if (ifd[DEV_RNUB] == -1) printf("Warning: couldn't find nub2 device\n"); + if (ifd[DEV_BUTTONS] == -1) { + printf("Error: couldn't find button device\n"); + /* buttons needed to exit this, so bail out */ + retval = -1; + goto end; + } #ifdef VALIDATION int early_leave_attempt = 0; diff --git a/scripts/op_test_inputs b/scripts/op_test_inputs index 929e946..b99a435 100755 --- a/scripts/op_test_inputs +++ b/scripts/op_test_inputs @@ -4,12 +4,10 @@ olddepth=`fbset | grep geometry | awk '{ print $6 }'` nub0mode=`cat /proc/pandora/nub0/mode` nub1mode=`cat /proc/pandora/nub1/mode` -echo absolute > /proc/pandora/nub0/mode -echo absolute > /proc/pandora/nub1/mode +/usr/pandora/scripts/op_nubchange.sh absolute absolute fbset -depth 16 op_runfbapp op_test_inputs_bin fbset -depth $olddepth -echo "$nub0mode" > /proc/pandora/nub0/mode -echo "$nub1mode" > /proc/pandora/nub1/mode +/usr/pandora/scripts/op_nubchange.sh $nub0mode $nub1mode