altos: unsigned value in ao_pyro_set checked for negative value
[fw/altos] / src / core / ao_pyro.c
index 24c9fe99cc04bf758f70031e2dbe74373a692b9e..e59f5bc4bdbf8881ab1c88a1970127ae687604bc 100644 (file)
@@ -115,11 +115,11 @@ ao_pyro_ready(struct ao_pyro *pyro)
 
 #if HAS_GYRO
                case ao_pyro_orient_less:
-                       if (ao_orient <= pyro->orient_less)
+                       if (ao_sample_orient <= pyro->orient_less)
                                continue;
                        break;
                case ao_pyro_orient_greater:
-                       if (ao_orient >= pyro->orient_greater)
+                       if (ao_sample_orient >= pyro->orient_greater)
                                continue;
                        break;
 #endif
@@ -436,7 +436,7 @@ ao_pyro_set(void)
        if (ao_cmd_status != ao_cmd_success)
                return;
        p = ao_cmd_lex_i;
-       if (p < 0 || AO_PYRO_NUM <= p) {
+       if (AO_PYRO_NUM <= p) {
                printf ("invalid pyro channel %d\n", p);
                return;
        }