void
ao_aes_set_mode(enum ao_aes_mode mode)
{
+ (void) mode;
/* we only do CBC_MAC anyways... */
}
static void
ao_config_show(void) __reentrant;
+#if HAS_EEPROM
static void
ao_config_save(void) __reentrant;
+#endif
__code struct ao_config_var ao_config_vars[] = {
#if HAS_FLIGHT
ao_fec_dump_bytes(const uint8_t *bytes, uint16_t len, const char *name);
#endif
-static uint16_t inline
+static inline uint16_t
ao_fec_crc_byte(uint8_t byte, uint16_t crc)
{
uint8_t bit;
static __xdata struct ao_log_metrum gps_log;
static __xdata struct ao_telemetry_location gps_data;
static __xdata struct ao_telemetry_satellite gps_tracking_data;
- uint8_t c, n, i, p, valid, packets;
+ uint8_t c, n, i;
uint8_t svid;
- uint8_t date_reported = 0;
uint8_t new;
for (;;) {
ao_log(void)
{
__pdata uint16_t next_sensor, next_other;
- uint8_t i;
ao_storage_setup();
static __xdata uint8_t ao_radio_cmac_mutex;
__pdata int8_t ao_radio_cmac_rssi;
static __xdata uint8_t cmac_data[AO_CMAC_MAX_LEN + AO_CMAC_KEY_LEN + 2 + AO_CMAC_KEY_LEN];
-static __pdata uint8_t ao_radio_cmac_len;
static uint8_t
round_len(uint8_t len)
{
if (--ao_telemetry_metrum_data_cur <= 0) {
__xdata struct ao_data *packet = (__xdata struct ao_data *) &ao_data_ring[ao_data_ring_prev(ao_sample_data)];
- uint8_t i;
telemetry.generic.tick = packet->tick;
telemetry.generic.type = AO_TELEMETRY_METRUM_DATA;
ao_radio_set_mode(uint16_t new_mode)
{
uint16_t changes;
- int i;
+ unsigned int i;
if (new_mode == ao_radio_mode)
return;
static void
ao_radio_setup(void)
{
- int i;
+ unsigned int i;
ao_radio_strobe(CC1120_SRES);
ao_companion_send_command(AO_COMPANION_SETUP);
ao_spi_recv(&ao_companion_setup, sizeof (ao_companion_setup), AO_COMPANION_SPI_BUS);
COMPANION_DESELECT();
- return (ao_companion_setup.board_id ==
- (uint16_t) ~ao_companion_setup.board_id_inverse);
+ return ((int16_t) ao_companion_setup.board_id ==
+ (int16_t) (uint16_t) (~ao_companion_setup.board_id_inverse));
}
static void
uint8_t ao_event_queue_remove;
-uint8_t
+void
ao_event_get(struct ao_event *ev)
{
ao_arch_critical(
int32_t value;
};
-uint8_t
+void
ao_event_get(struct ao_event *ev);
void
static void
lco_fire_cmd(void) __reentrant
{
- static __xdata struct ao_pad_command command;
uint8_t secs;
uint8_t i;
int8_t r;
int8_t
ao_lco_query(uint16_t box, struct ao_pad_query *query, uint16_t *tick_offset)
{
- uint8_t i;
int8_t r;
uint16_t sent_time;
#endif
static uint8_t
-ao_mpu6000_accel_check(int16_t normal, int16_t test, char *which)
+ao_mpu6000_accel_check(int16_t normal, int16_t test)
{
int16_t diff = test - normal;
}
static uint8_t
-ao_mpu6000_gyro_check(int16_t normal, int16_t test, char *which)
+ao_mpu6000_gyro_check(int16_t normal, int16_t test)
{
int16_t diff = test - normal;
ao_delay(AO_MS_TO_TICKS(200));
_ao_mpu6000_sample(&normal_mode);
- errors += ao_mpu6000_accel_check(normal_mode.accel_x, test_mode.accel_x, "x");
- errors += ao_mpu6000_accel_check(normal_mode.accel_y, test_mode.accel_y, "y");
- errors += ao_mpu6000_accel_check(normal_mode.accel_z, test_mode.accel_z, "z");
+ errors += ao_mpu6000_accel_check(normal_mode.accel_x, test_mode.accel_x);
+ errors += ao_mpu6000_accel_check(normal_mode.accel_y, test_mode.accel_y);
+ errors += ao_mpu6000_accel_check(normal_mode.accel_z, test_mode.accel_z);
- errors += ao_mpu6000_gyro_check(normal_mode.gyro_x, test_mode.gyro_x, "x");
- errors += ao_mpu6000_gyro_check(normal_mode.gyro_y, test_mode.gyro_y, "y");
- errors += ao_mpu6000_gyro_check(normal_mode.gyro_z, test_mode.gyro_z, "z");
+ errors += ao_mpu6000_gyro_check(normal_mode.gyro_x, test_mode.gyro_x);
+ errors += ao_mpu6000_gyro_check(normal_mode.gyro_y, test_mode.gyro_y);
+ errors += ao_mpu6000_gyro_check(normal_mode.gyro_z, test_mode.gyro_z);
if (!errors)
break;
}
fn = (float)n;
r = t-fn*pio2_1;
w = fn*pio2_1t; /* 1st round good to 40 bit */
- if(n<32&&(ix&0xffffff00)!=npio2_hw[n-1]) {
+ if(n<32&&(ix&(__int32_t)0xffffff00)!=npio2_hw[n-1]) {
y[0] = r-w; /* quick check no cancellation */
} else {
__uint32_t high;
*/
static void ao_adc_done(int index)
{
+ (void) index;
AO_DATA_PRESENT(AO_DATA_ADC);
ao_dma_done_transfer(STM_DMA_INDEX(STM_DMA_CHANNEL_ADC1));
if (ao_data_present == AO_DATA_ALL) {
void
ao_exti_set_mode(struct stm_gpio *gpio, uint8_t pin, uint8_t mode) {
+ (void) gpio;
+
uint32_t mask = 1 << pin;
if (mode & AO_EXTI_MODE_RISING)
void
ao_exti_set_callback(struct stm_gpio *gpio, uint8_t pin, void (*callback)()) {
+ (void) gpio;
ao_exti_callback[pin] = callback;
}
void
ao_exti_enable(struct stm_gpio *gpio, uint8_t pin) {
uint32_t mask = (1 << pin);
+ (void) gpio;
stm_exti.pr = mask;
stm_exti.imr |= (1 << pin);
}
void
ao_exti_disable(struct stm_gpio *gpio, uint8_t pin) {
uint32_t mask = (1 << pin);
+ (void) gpio;
stm_exti.imr &= ~mask;
stm_exti.pr = mask;
}
void
ao_lcd_stm_init(void)
{
- int s, c;
- int r;
+ unsigned int s, c;
uint32_t csr;
stm_rcc.ahbenr |= ((AO_LCD_STM_USES_GPIOA << STM_RCC_AHBENR_GPIOAEN) |
void ao_profile_init();
-static uint32_t inline ao_profile_tick(void) {
+static inline uint32_t ao_profile_tick(void) {
uint16_t hi, lo, second_hi;
do {
ao_dma_done_transfer(miso_dma_index);
}
-
uint8_t
ao_spi_slave_recv(void *block, uint16_t len)
{
ao_dma_done_transfer(mosi_dma_index);
ao_dma_done_transfer(miso_dma_index);
+ return 1;
}
static void
value << STM_MODER_SHIFT(pin));
}
-static inline vuint32_t
+static inline uint32_t
stm_moder_get(struct stm_gpio *gpio, int pin) {
return (gpio->moder >> STM_MODER_SHIFT(pin)) & STM_MODER_MASK;
}
value << STM_OTYPER_SHIFT(pin));
}
-static inline vuint32_t
+static inline uint32_t
stm_otyper_get(struct stm_gpio *gpio, int pin) {
return (gpio->otyper >> STM_OTYPER_SHIFT(pin)) & STM_OTYPER_MASK;
}
value << STM_OSPEEDR_SHIFT(pin));
}
-static inline vuint32_t
+static inline uint32_t
stm_ospeedr_get(struct stm_gpio *gpio, int pin) {
return (gpio->ospeedr >> STM_OSPEEDR_SHIFT(pin)) & STM_OSPEEDR_MASK;
}
#define AO_LCO_BOX_DIGIT_10 2
static uint8_t ao_lco_min_box, ao_lco_max_box;
-static uint8_t ao_lco_mutex;
static uint8_t ao_lco_pad;
static uint8_t ao_lco_box;
static uint8_t ao_lco_armed;
ao_lco_igniter_status(void)
{
uint8_t c;
- uint16_t delay;
for (;;) {
-// ao_alarm(delay);
ao_sleep(&ao_pad_query);
-// ao_clear_alarm();
if (!ao_lco_valid) {
ao_led_on(AO_LED_RED);
ao_led_off(AO_LED_GREEN|AO_LED_AMBER);