|
26 | 26 | #define HAS_FLIGHT 0
|
27 | 27 | #define HAS_USB 1
|
28 | 28 | #define HAS_BEEP 1
|
29 |
| -#define BEEPER_CHANNEL 4 |
| 29 | +#define BEEPER_PORT (&stm_gpiob) |
| 30 | +#define BEEPER_PIN 1 |
30 | 31 | #define BEEPER_TIMER 3
|
| 32 | +#define BEEPER_CHANNEL 4 |
31 | 33 | #define HAS_GPS 0
|
32 | 34 | #define HAS_SERIAL_1 0
|
33 | 35 | #define HAS_ADC 1
|
|
118 | 120 | #define AO_CC1200_INT_GPIO 2
|
119 | 121 | #define AO_CC1200_INT_GPIO_IOCFG CC1200_IOCFG2
|
120 | 122 |
|
121 |
| -#define LED_PORT_0 (&stm_gpioa) |
122 |
| -#define LED_PORT_1 (&stm_gpiob) |
123 |
| - |
124 |
| -#define LED_PORT_0_ENABLE STM_RCC_AHBENR_GPIOAEN |
125 |
| -#define LED_PORT_1_ENABLE STM_RCC_AHBENR_GPIOBEN |
| 123 | +#define HAS_LED 1 |
126 | 124 |
|
127 | 125 | /* Port A, pins 4-6 */
|
128 |
| -#define LED_PORT_0_SHIFT 4 |
129 |
| -#define LED_PORT_0_MASK 0x7 |
130 |
| -#define LED_PIN_GREEN 0 |
131 |
| -#define LED_PIN_AMBER 1 |
132 |
| -#define LED_PIN_RED 2 |
133 |
| -#define AO_LED_RED (1 << LED_PIN_RED) |
134 |
| -#define AO_LED_AMBER (1 << LED_PIN_AMBER) |
135 |
| -#define AO_LED_GREEN (1 << LED_PIN_GREEN) |
| 126 | +#define LED_0_PORT (&stm_gpioa) |
| 127 | +#define LED_0_PIN 4 |
| 128 | +#define LED_1_PORT (&stm_gpioa) |
| 129 | +#define LED_1_PIN 5 |
| 130 | +#define LED_2_PORT (&stm_gpioa) |
| 131 | +#define LED_2_PIN 6 |
| 132 | + |
| 133 | +#define AO_LED_GREEN AO_LED_0 |
| 134 | +#define AO_LED_AMBER AO_LED_1 |
| 135 | +#define AO_LED_RED AO_LED_2 |
136 | 136 |
|
137 | 137 | /* Port B, pins 4-5 */
|
| 138 | +#define LED_3_PORT (&stm_gpiob) |
| 139 | +#define LED_3_PIN 4 |
| 140 | +#define LED_4_PORT (&stm_gpiob) |
| 141 | +#define LED_4_PIN 5 |
138 | 142 | #define LED_PORT_1_SHIFT 0
|
139 | 143 | #define LED_PORT_1_MASK (0x3 << 4)
|
140 | 144 | #define LED_PIN_CONT_0 4
|
141 | 145 | #define LED_PIN_ARMED 5
|
142 | 146 |
|
143 |
| -#define AO_LED_ARMED (1 << LED_PIN_ARMED) |
144 |
| -#define AO_LED_CONTINUITY(c) (1 << (4 - (c))) |
145 |
| -#define AO_LED_CONTINUITY_MASK (0x1 << 4) |
146 |
| - |
147 |
| -#define LEDS_AVAILABLE (LED_PORT_0_MASK|LED_PORT_1_MASK) |
| 147 | +#define AO_LED_ARMED AO_LED_3 |
| 148 | +#define AO_LED_CONTINUITY(c) AO_LED_4 |
| 149 | +#define AO_LED_CONTINUITY_MASK AO_LED_4 |
148 | 150 |
|
149 | 151 | /* Alarm A */
|
150 | 152 | #define AO_SIREN
|
|
183 | 185 | #define AO_ADC_SQ2 AO_PAD_ADC_PYRO
|
184 | 186 | #define AO_ADC_SQ3 AO_PAD_ADC_BATT
|
185 | 187 |
|
186 |
| -#define AO_PYRO_R_PYRO_SENSE 200 |
187 |
| -#define AO_PYRO_R_SENSE_GND 22 |
| 188 | +#define AO_PAD_R_V_BATT_BATT_SENSE 200 |
| 189 | +#define AO_PAD_R_BATT_SENSE_GND 22 |
| 190 | +#define AO_PAD_R_V_PYRO_PYRO_SENSE 200 |
| 191 | +#define AO_PAD_R_PYRO_SENSE_GND 22 |
| 192 | + |
| 193 | +#define AO_PAD_R_IGNITER_IGNITER_SENSE 200 |
| 194 | +#define AO_PAD_R_IGNITER_SENSE_GND 22 |
188 | 195 |
|
189 | 196 | #define AO_FIRE_R_POWER_FET 0
|
190 | 197 | #define AO_FIRE_R_FET_SENSE 200
|
191 | 198 | #define AO_FIRE_R_SENSE_GND 22
|
192 | 199 |
|
193 | 200 | #define HAS_ADC_TEMP 0
|
194 | 201 |
|
| 202 | +#define AO_ADC_REFERENCE_DV 33 |
| 203 | + |
195 | 204 | struct ao_adc {
|
196 | 205 | int16_t sense[AO_PAD_NUM];
|
197 | 206 | int16_t pyro;
|
198 | 207 | int16_t batt;
|
199 | 208 | };
|
200 | 209 |
|
201 | 210 | #define AO_ADC_DUMP(p) \
|
202 |
| - printf ("tick: %5u 0: %5d pyro: %5d batt %5d\n", \ |
| 211 | + printf ("tick: %5lu 0: %5d pyro: %5d batt %5d\n", \ |
203 | 212 | (p)->tick, \
|
204 | 213 | (p)->adc.sense[0], \
|
205 | 214 | (p)->adc.pyro, \
|
|
0 commit comments