Skip to content

Commit a2d18d4

Browse files
committed
altos/telefiretwo-v0.2: Get things building again
This code got very stale and needed some config updates Signed-off-by: Keith Packard <[email protected]>
1 parent 05aacbd commit a2d18d4

File tree

3 files changed

+37
-29
lines changed

3 files changed

+37
-29
lines changed

src/telefiretwo-v0.2/Makefile

+2-5
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ ALTOS_SRC = \
3333
ao_data.c \
3434
ao_config.c \
3535
ao_task.c \
36-
ao_led_stm.c \
36+
ao_led.c \
3737
ao_stdio.c \
3838
ao_panic.c \
3939
ao_timer.c \
@@ -71,13 +71,10 @@ OBJ=$(SRC:.c=.o)
7171
all: $(PROG) $(HEX)
7272

7373
$(PROG): Makefile $(OBJ) altos.ld
74-
$(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(OBJ) $(LIBS)
74+
$(call quiet,CC) $(LDFLAGS) -o $(PROG) $(OBJ) $(LIBS)
7575

7676
$(OBJ): $(INC)
7777

78-
ao_product.h: ao-make-product.5c ../Version
79-
$(call quiet,NICKLE,$<) $< -m altusmetrum.org -i $(IDPRODUCT) -p $(PRODUCT) -v $(VERSION) > $@
80-
8178
distclean: clean
8279

8380
clean:

src/telefiretwo-v0.2/ao_pins.h

+31-22
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,10 @@
2626
#define HAS_FLIGHT 0
2727
#define HAS_USB 1
2828
#define HAS_BEEP 1
29-
#define BEEPER_CHANNEL 4
29+
#define BEEPER_PORT (&stm_gpiob)
30+
#define BEEPER_PIN 1
3031
#define BEEPER_TIMER 3
32+
#define BEEPER_CHANNEL 4
3133
#define HAS_GPS 0
3234
#define HAS_SERIAL_1 0
3335
#define HAS_ADC 1
@@ -118,33 +120,33 @@
118120
#define AO_CC1200_INT_GPIO 2
119121
#define AO_CC1200_INT_GPIO_IOCFG CC1200_IOCFG2
120122

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
126124

127125
/* 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
136136

137137
/* 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
138142
#define LED_PORT_1_SHIFT 0
139143
#define LED_PORT_1_MASK (0x3 << 4)
140144
#define LED_PIN_CONT_0 4
141145
#define LED_PIN_ARMED 5
142146

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
148150

149151
/* Alarm A */
150152
#define AO_SIREN
@@ -183,23 +185,30 @@
183185
#define AO_ADC_SQ2 AO_PAD_ADC_PYRO
184186
#define AO_ADC_SQ3 AO_PAD_ADC_BATT
185187

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
188195

189196
#define AO_FIRE_R_POWER_FET 0
190197
#define AO_FIRE_R_FET_SENSE 200
191198
#define AO_FIRE_R_SENSE_GND 22
192199

193200
#define HAS_ADC_TEMP 0
194201

202+
#define AO_ADC_REFERENCE_DV 33
203+
195204
struct ao_adc {
196205
int16_t sense[AO_PAD_NUM];
197206
int16_t pyro;
198207
int16_t batt;
199208
};
200209

201210
#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", \
203212
(p)->tick, \
204213
(p)->adc.sense[0], \
205214
(p)->adc.pyro, \

src/telefiretwo-v0.2/ao_telefiretwo.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,14 @@
2020
#include <ao_pad.h>
2121
#include <ao_exti.h>
2222
#include <ao_radio_cmac_cmd.h>
23+
#include <ao_led.h>
2324

24-
void
25+
int
2526
main(void)
2627
{
2728
ao_clock_init();
2829

29-
ao_led_init(LEDS_AVAILABLE);
30+
ao_led_init();
3031

3132
ao_task_init();
3233

@@ -52,4 +53,5 @@ main(void)
5253
// ao_radio_cmac_cmd_init();
5354

5455
ao_start_scheduler();
56+
return 0;
5557
}

0 commit comments

Comments
 (0)