summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2017-02-18 22:56:49 -0800
committerKeith Packard <keithp@keithp.com>2017-02-20 11:16:53 -0800
commitc75736c9cd8f869c257a3024efda843cf0edf2a3 (patch)
tree35dde74f202abcd833bf1c392d6307c875da07ea /src
parentefdeb402d04e7f04ad4bd2764f8f1ca7270b3dff (diff)
altos/telemini-v3.0: Finish initial turn-on
TeleMini v3.0 is nearly working; there are some ADC issues still, and lots of altosui work left to decode the new telemetry packet. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src')
-rw-r--r--src/telemini-v3.0/ao_pins.h26
-rw-r--r--src/telemini-v3.0/ao_telemini.c19
-rw-r--r--src/telemini-v3.0/ao_telemini_calibrate.c9
3 files changed, 35 insertions, 19 deletions
diff --git a/src/telemini-v3.0/ao_pins.h b/src/telemini-v3.0/ao_pins.h
index 6672a8da..031c1d18 100644
--- a/src/telemini-v3.0/ao_pins.h
+++ b/src/telemini-v3.0/ao_pins.h
@@ -16,9 +16,11 @@
*/
#define HAS_BEEP 1
+#define HAS_SERIAL_1 0
#define HAS_BATTERY_REPORT 1
+#define HAS_BOOT_LOADER 0
-#define AO_STACK_SIZE 384
+#define AO_STACK_SIZE 448
#define RELOCATE_INTERRUPT 0
@@ -72,24 +74,23 @@
#define LED_PIN_GREEN 15
#define AO_LED_GREEN (1 << 15)
#define AO_LED_PANIC AO_LED_GREEN
+#define AO_LED_LOW AO_LED_GREEN
+#define AO_LED_MID AO_LED_GREEN
#define LEDS_AVAILABLE AO_LED_GREEN
-/* USART */
+/* Serial. Hooked to the spare pin (PA9/19) and the beeper (PA10/20) */
-#define HAS_SERIAL 0
-#define USE_SERIAL_0_STDIN 1
-#define SERIAL_0_18_19 1
-#define SERIAL_0_14_15 0
-#define SERIAL_0_17_18 0
-#define SERIAL_0_26_27 0
+#define SERIAL_1_PA9_PA10 1
+#define USE_SERIAL_1_STDIN HAS_SERIAL_1
+#define DELAY_SERIAL_1_STDIN 0
/* SPI */
#define HAS_SPI_1 1
-#define SPI_SCK1_P1_15 1
-#define SPI_MISO1_P0_22 1
-#define SPI_MOSI1_P0_21 1
+#define SPI_1_PA5_PA6_PA7 1
+#define SPI_1_PB3_PB4_PB5 1
+#define SPI_1_OSPEEDR STM_OSPEEDR_MEDIUM
/* M25 */
@@ -110,6 +111,7 @@
#define AO_MS5607_MISO_PIN 4
#define AO_MS5607_MISO_MASK (1 << AO_MS5607_MISO_PIN)
#define AO_MS5607_SPI_INDEX AO_SPI_1_PB3_PB4_PB5
+#define AO_MS5607_SPI_SPEED AO_SPI_SPEED_12MHz
/* CC1200 */
@@ -117,10 +119,12 @@
#define AO_RADIO_CAL_DEFAULT 5695717
#define AO_FEC_DEBUG 0
+#define CC1200_DEBUG 0
#define AO_CC1200_SPI_CS_PORT (&stm_gpiob)
#define AO_CC1200_SPI_CS_PIN 0
#define AO_CC1200_SPI_BUS AO_SPI_1_PA5_PA6_PA7
#define AO_CC1200_SPI stm_spi1
+#define AO_CC1200_SPI_SPEED AO_SPI_SPEED_12MHz
#define AO_CC1200_INT_PORT (&stm_gpiob)
#define AO_CC1200_INT_PIN 1
diff --git a/src/telemini-v3.0/ao_telemini.c b/src/telemini-v3.0/ao_telemini.c
index d5fbb04e..c2c13236 100644
--- a/src/telemini-v3.0/ao_telemini.c
+++ b/src/telemini-v3.0/ao_telemini.c
@@ -33,22 +33,25 @@ main(void)
ao_adc_init();
+#if HAS_BEEP
ao_beep_init();
+#endif
+#if HAS_SERIAL_1
+ ao_serial_init();
+#endif
ao_cmd_init();
-// ao_ms5607_init();
+ ao_ms5607_init();
ao_storage_init();
-// ao_flight_init();
-// ao_log_init();
-// ao_report_init();
-// ao_telemetry_init();
+ ao_flight_init();
+ ao_log_init();
+ ao_report_init();
+ ao_telemetry_init();
ao_radio_init();
ao_packet_slave_init(TRUE);
-// ao_igniter_init();
+ ao_igniter_init();
ao_config_init();
- ao_flight_force_idle = TRUE;
-
ao_start_scheduler();
}
diff --git a/src/telemini-v3.0/ao_telemini_calibrate.c b/src/telemini-v3.0/ao_telemini_calibrate.c
index 7a9d7986..461810f0 100644
--- a/src/telemini-v3.0/ao_telemini_calibrate.c
+++ b/src/telemini-v3.0/ao_telemini_calibrate.c
@@ -22,7 +22,11 @@ static void
ao_cal(void)
{
ao_config_get();
+#if HAS_BEEP
ao_beep_for(AO_BEEP_MID, AO_MS_TO_TICKS(500));
+#else
+ ao_led_for(AO_LED_MID, AO_MS_TO_TICKS(500));
+#endif
for (;;) {
ao_led_on(AO_LED_GREEN);
ao_radio_test_on();
@@ -49,7 +53,12 @@ main(void)
ao_exti_init();
// ao_adc_init();
+#if HAS_BEEP
ao_beep_init();
+#endif
+#if HAS_SERIAL_1
+ ao_serial_init();
+#endif
// ao_cmd_init();
// ao_ms5607_init();