X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src-avr%2Fao.h;h=6d025c99d78acd6ba70bb265b41041e95e747030;hb=d6f828b56b55abaebad2d47a57e40783c042602d;hp=ed27a156e171f577331343818b61abc5e65123b6;hpb=30a3e1570d74be9efa0a1a09d6fc9ec979627f99;p=fw%2Faltos diff --git a/src-avr/ao.h b/src-avr/ao.h index ed27a156..6d025c99 100644 --- a/src-avr/ao.h +++ b/src-avr/ao.h @@ -50,7 +50,11 @@ struct ao_task { __xdata void *wchan; /* current wait channel (NULL if running) */ uint16_t alarm; /* abort ao_sleep time */ +#ifdef AVR + uint8_t *sp; /* saved stack pointer */ +#else uint8_t stack_count; /* amount of saved stack */ +#endif uint8_t task_id; /* unique id */ __code char *name; /* task name */ uint8_t stack[AO_STACK_SIZE]; /* saved stack */ @@ -61,6 +65,10 @@ extern __xdata struct ao_task *__data ao_cur_task; #define AO_NUM_TASKS 16 /* maximum number of tasks */ #define AO_NO_TASK 0 /* no task id */ +#ifdef AVR +extern uint8_t ao_cpu_sleep_disable; +#endif + /* ao_task.c */ @@ -161,14 +169,22 @@ ao_clock_init(void); /* * One set of samples read from the A/D converter or telemetry */ +#ifdef AVR +#define NUM_ADC 12 +#endif + struct ao_adc { uint16_t tick; /* tick when the sample was read */ +#ifdef AVR + uint16_t adc[NUM_ADC]; /* samples */ +#else int16_t accel; /* accelerometer */ int16_t pres; /* pressure sensor */ int16_t temp; /* temperature sensor */ int16_t v_batt; /* battery voltage */ int16_t sense_d; /* drogue continuity sense */ int16_t sense_m; /* main continuity sense */ +#endif }; #if HAS_ADC @@ -185,7 +201,8 @@ struct ao_adc { * ao_adc.c */ -#define AO_ADC_RING 32 +#define AO_ADC_RING 16 + #define ao_adc_ring_next(n) (((n) + 1) & (AO_ADC_RING - 1)) #define ao_adc_ring_prev(n) (((n) - 1) & (AO_ADC_RING - 1)) @@ -326,8 +343,12 @@ extern __code __at (0x00a0) struct ao_romconfig ao_romconfig; #endif #if HAS_USB +#ifdef AVR +extern const uint8_t ao_usb_descriptors []; +#else extern __code __at (0x00aa) uint8_t ao_usb_descriptors []; #endif +#endif /* * ao_usb.c