/*
- * Copyright © 2012 Keith Packard <keithp@keithp.com>
+ * Copyright © 2014 Bdale Garbee <bdale@gag.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
#define HAS_SERIAL_1 0
#define USE_SERIAL_1_STDIN 0
#define SERIAL_1_PB6_PB7 0
-#define SERIAL_1_PA9_PA10 1
+#define SERIAL_1_PA9_PA10 0
#define HAS_SERIAL_2 0
#define USE_SERIAL_2_STDIN 0
#define HAS_SERIAL_3 0
#define USE_SERIAL_3_STDIN 0
#define SERIAL_3_PB10_PB11 0
-#define SERIAL_3_PC10_PC11 1
+#define SERIAL_3_PC10_PC11 0
#define SERIAL_3_PD8_PD9 0
+#define ao_gps_getchar ao_serial1_getchar
+#define ao_gps_putchar ao_serial1_putchar
+#define ao_gps_set_speed ao_serial1_set_speed
+#define ao_gps_fifo (ao_stm_usart1.rx_fifo)
+
#define AO_CONFIG_DEFAULT_FLIGHT_LOG_MAX (1024 * 1024)
+#define AO_CONFIG_MAX_SIZE 1024
+#define LOG_ERASE_MARK 0x55
+#define LOG_MAX_ERASE 128
#define HAS_EEPROM 1
#define USE_INTERNAL_FLASH 0
#define USE_EEPROM_CONFIG 1
#define USE_STORAGE_CONFIG 0
#define HAS_USB 1
#define HAS_BEEP 1
+#define HAS_BATTERY_REPORT 1
#define HAS_RADIO 0
#define HAS_TELEMETRY 0
#define HAS_APRS 0
+#define HAS_COMPANION 1
#define HAS_SPI_1 1
#define SPI_1_PA5_PA6_PA7 1 /* Barometer */
#define SPI_1_PB3_PB4_PB5 1 /* Accelerometer, Gyro */
-#define SPI_1_PE13_PE14_PE15 0
+#define SPI_1_PE13_PE14_PE15 0
#define SPI_1_OSPEEDR STM_OSPEEDR_10MHz
#define HAS_SPI_2 1
#define SPI_2_PD1_PD3_PD4 0
#define SPI_2_OSPEEDR STM_OSPEEDR_10MHz
-#if 0
#define SPI_2_PORT (&stm_gpiob)
#define SPI_2_SCK_PIN 13
#define SPI_2_MISO_PIN 14
#define SPI_2_MOSI_PIN 15
-#endif
#define HAS_I2C_1 1
#define I2C_1_PB8_PB9 1
#define LOW_LEVEL_DEBUG 0
-#define LED_PORT_ENABLE STM_RCC_AHBENR_GPIOCEN
+#define LED_PORT_ENABLE STM_RCC_AHBENR_GPIOAEN
#define LED_PORT (&stm_gpioa)
#define LED_PIN_RED 9
#define LED_PIN_GREEN 10
#define AO_ADC_SENSE_MAIN 10
#define AO_ADC_SENSE_MAIN_PORT (&stm_gpioc)
-#define AO_ADC_SENSE_MAIN_PIN 0
+#define AO_ADC_SENSE_MAIN_PIN 0
#define AO_ADC_V_BATT 8
#define AO_ADC_V_BATT_PORT (&stm_gpiob)
#define AO_ADC_TEMP 16
-#define AO_ADC_RCC_AHBENR ((1 << STM_RCC_AHBENR_GPIOEEN) | \
+#define AO_ADC_RCC_AHBENR ((1 << STM_RCC_AHBENR_GPIOAEN) | \
+ (1 << STM_RCC_AHBENR_GPIOEEN) | \
(1 << STM_RCC_AHBENR_GPIOBEN))
#define AO_NUM_ADC_PIN (AO_ADC_NUM_SENSE + 2)
#define AO_MS5607_PRIVATE_PINS 1
#define AO_MS5607_CS_PORT (&stm_gpioa)
#define AO_MS5607_CS_PIN 3
-#define AO_MS5607_CS_MASK (1 << AO_MS5607_CS)
+#define AO_MS5607_CS_MASK (1 << AO_MS5607_CS_PIN)
#define AO_MS5607_MISO_PORT (&stm_gpioa)
#define AO_MS5607_MISO_PIN 6
-#define AO_MS5607_MISO_MASK (1 << AO_MS5607_MISO)
+#define AO_MS5607_MISO_MASK (1 << AO_MS5607_MISO_PIN)
#define AO_MS5607_SPI_INDEX AO_SPI_1_PA5_PA6_PA7
/*
#define M25_MAX_CHIPS 1
#define AO_M25_SPI_CS_PORT (&stm_gpiob)
-#define AO_M25_SPI_CS_MASK (1 << 12)
+#define AO_M25_SPI_CS_PIN 12
+#define AO_M25_SPI_CS_MASK (1 << AO_M25_SPI_CS_PIN)
#define AO_M25_SPI_BUS AO_SPI_2_PB13_PB14_PB15
/*