altos: Make sure AO_MMA655X_INVERT is declared where needed
authorKeith Packard <keithp@keithp.com>
Mon, 2 May 2016 23:19:39 +0000 (16:19 -0700)
committerKeith Packard <keithp@keithp.com>
Mon, 2 May 2016 23:19:39 +0000 (16:19 -0700)
Add #define AO_MMA655X_INVERT 0 to existing products which didn't
declare it at all. This will make sure the value is set correctly for
each new board.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/easymega-v1.0/ao_pins.h
src/kernel/ao_data.h
src/telemega-v0.1/ao_pins.h
src/telemega-v1.0/ao_pins.h
src/telemega-v2.0/ao_pins.h

index a5e556384615a6e6a52b2b4b615de5302c119b66..773e58d9709cdff034b5e7632bbbe2bec8afd4fb 100644 (file)
@@ -321,6 +321,7 @@ struct ao_adc {
  */
 
 #define HAS_MMA655X            1
+#define AO_MMA655X_INVERT      0
 #define AO_MMA655X_SPI_INDEX   AO_SPI_1_PB3_PB4_PB5
 #define AO_MMA655X_CS_PORT     (&stm_gpioc)
 #define AO_MMA655X_CS_PIN      12
index 8f75ad876b612e3cc1480e1fc9aa9fc8024908bd..6ee0965d4e732ed4ce25adec78ac11231942356e 100644 (file)
@@ -269,6 +269,10 @@ typedef int16_t accel_t;
 
 #define AO_ACCEL_INVERT                4095
 
+#ifndef AO_MMA655X_INVERT
+#error AO_MMA655X_INVERT not defined
+#endif
+
 #define ao_data_accel(packet)                  ((packet)->mma655x)
 #if AO_MMA655X_INVERT
 #define ao_data_accel_cook(packet)             (AO_ACCEL_INVERT - (packet)->mma655x)
index 7ccc6085ba1b49139dcf1c6ba164304a2393b19f..1815ef547304c695b4538e6b9657a2f476a9fe73 100644 (file)
@@ -346,6 +346,7 @@ struct ao_adc {
  */
 
 #define HAS_MMA655X            1
+#define AO_MMA655X_INVERT      0
 #define AO_MMA655X_SPI_INDEX   AO_SPI_1_PE13_PE14_PE15
 #define AO_MMA655X_CS_PORT     (&stm_gpiod)
 #define AO_MMA655X_CS_PIN      4
index 664546c2fc02d4ba3aa5b0462b6b0bae747f24dd..b81e59a9a340bb309c88a66a41f09a56d36a554f 100644 (file)
@@ -348,6 +348,7 @@ struct ao_adc {
  */
 
 #define HAS_MMA655X            1
+#define AO_MMA655X_INVERT      0
 #define AO_MMA655X_SPI_INDEX   AO_SPI_1_PE13_PE14_PE15
 #define AO_MMA655X_CS_PORT     (&stm_gpiod)
 #define AO_MMA655X_CS_PIN      4
index 9095a350f1757713637870d80eee78220f5cf82b..242f0ab229216d60b3de0c9573b7fb55a1ff5fc3 100644 (file)
@@ -348,6 +348,7 @@ struct ao_adc {
  */
 
 #define HAS_MMA655X            1
+#define AO_MMA655X_INVERT      0
 #define AO_MMA655X_SPI_INDEX   AO_SPI_1_PE13_PE14_PE15
 #define AO_MMA655X_CS_PORT     (&stm_gpiod)
 #define AO_MMA655X_CS_PIN      4