summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2012-07-16 15:27:58 -0700
committerKeith Packard <keithp@keithp.com>2012-07-16 15:27:58 -0700
commit6581eefbdbd8d3e94f615bdf11652a000d131c8e (patch)
tree21cc971c5cee4a8c032faea4af526e8a48e0e401 /src
parent1887ca3d7d4a0259686f8c1e68d1e47c47b4ab84 (diff)
altos: Use 'HAS_ORIENT' to enable orientation selection in pyro code
Don't expose orientation options when no orientation data is available Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src')
-rw-r--r--src/core/ao_pyro.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/core/ao_pyro.c b/src/core/ao_pyro.c
index b0d45162..162f5e1e 100644
--- a/src/core/ao_pyro.c
+++ b/src/core/ao_pyro.c
@@ -66,14 +66,16 @@ ao_pyro_ready(struct ao_pyro *pyro)
continue;
break;
+#if HAS_ORIENT
case ao_pyro_orient_less:
-// if (ao_orient <= pyro->orient_less)
+ if (ao_orient <= pyro->orient_less)
continue;
break;
case ao_pyro_orient_greater:
-// if (ao_orient >= pyro->orient_greater)
+ if (ao_orient >= pyro->orient_greater)
continue;
break;
+#endif
case ao_pyro_time_less:
if ((int16_t) (ao_time() - ao_boost_tick) <= pyro->time_less)
@@ -102,8 +104,8 @@ ao_pyro_ready(struct ao_pyro *pyro)
/* handled separately */
continue;
- case ao_pyro_none:
- break;
+ default:
+ continue;
}
return FALSE;
}
@@ -234,7 +236,7 @@ const struct {
{ "h<", ao_pyro_height_less, offsetof(struct ao_pyro, height_less), HELP("height less (m)") },
{ "h>", ao_pyro_height_greater, offsetof(struct ao_pyro, height_greater), HELP("height greater (m)") },
-#if 0
+#if HAS_ORIENT
{ "o<", ao_pyro_orient_less, offsetof(struct ao_pyro, orient_less), HELP("orient less (deg)") },
{ "o>", ao_pyro_orient_greater, offsetof(struct ao_pyro, orient_greater), HELP("orient greater (deg)") },
#endif
@@ -281,6 +283,7 @@ ao_pyro_show(void)
uint8_t v;
struct ao_pyro *pyro;
+ printf ("Pyro-count: %d\n", AO_PYRO_NUM);
for (p = 0; p < AO_PYRO_NUM; p++) {
printf ("Pyro %2d: ", p);
pyro = &ao_config.pyro[p];