}
void
-ao_delay_until(uint16_t target) {
+ao_delay_until(AO_TICK_TYPE target) {
int16_t delay = target - ao_time();
if (delay > 0) {
ao_sleep_for(ao_delay_until, delay);
stm_rcc.apb2enr &= ~(1 << STM_RCC_APB2ENR_ADCEN);
}
-static uint16_t
+static AO_TICK_TYPE
ao_battery_voltage(void)
{
- uint16_t vrefint;
+ AO_TICK_TYPE vrefint;
ao_battery_init();
static void
ao_log_erase(void)
{
- uint32_t pos;
- for (pos = 0; pos < ao_storage_log_max; pos += ao_storage_block)
- ao_storage_erase(pos);
+ ao_storage_erase(0, ao_storage_log_max);
}
uint8_t ao_on_battery;
uint8_t
ao_log_present(void)
{
- uint16_t n_samples;
+ AO_TICK_TYPE n_samples;
ao_eeprom_read(N_SAMPLES_OFFSET, &n_samples, sizeof (n_samples));
if (ao_log_present())
printf ("flight %d start %x end %x\n",
1,
- 0, MAX_LOG_OFFSET >> 8);
+ 0, (unsigned) (MAX_LOG_OFFSET >> 8));
printf ("done\n");
}
stm_rcc.csr |= (1 << STM_RCC_CSR_RMVF);
}
-void
+int
main(void)
{
int i;