altos: Fix pad orientation for pre-1.1 boards
authorKeith Packard <keithp@keithp.com>
Mon, 14 Nov 2011 07:03:22 +0000 (23:03 -0800)
committerKeith Packard <keithp@keithp.com>
Mon, 14 Nov 2011 07:03:22 +0000 (23:03 -0800)
They use a different code path for accel as they don't have the
VCC compensation code in place.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/core/ao_sample.c

index b2b8e9f63ff662385054b6a904797f38e6c77ce9..2bf9632fdb87a79062e7bff7d40ea7a14894dfbd 100644 (file)
@@ -182,6 +182,11 @@ ao_sample(void)
                if (ao_config.pad_orientation != AO_PAD_ORIENTATION_ANTENNA_UP)
                        ao_sample_accel = 0x7fff - ao_sample_accel;
                ao_adc->accel = ao_sample_accel;
                if (ao_config.pad_orientation != AO_PAD_ORIENTATION_ANTENNA_UP)
                        ao_sample_accel = 0x7fff - ao_sample_accel;
                ao_adc->accel = ao_sample_accel;
+#else
+               if (ao_config.pad_orientation != AO_PAD_ORIENTATION_ANTENNA_UP) {
+                       ao_sample_accel = 0x7fff - ao_sample_accel;
+                       ao_adc->accel = ao_sample_accel;
+               }
 #endif
 #endif
 
 #endif
 #endif