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 */
#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
*/
/*
* 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
* 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))
#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