X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=src%2Fao.h;h=2e2fb589f1916dd20304c3a2cfe82ade5092ed4f;hp=e86b4bf99cf81840f95bd876a911deb31f842c31;hb=b428faf74ae145126ec1da972028fcfe0b4b2b18;hpb=7b14c3e609749f4fc00dbd660541375048535218 diff --git a/src/ao.h b/src/ao.h index e86b4bf9..2e2fb589 100644 --- a/src/ao.h +++ b/src/ao.h @@ -40,6 +40,7 @@ /* An AltOS task */ struct ao_task { __xdata void *wchan; /* current wait channel (NULL if running) */ + uint16_t alarm; /* abort ao_sleep time */ uint8_t stack_count; /* amount of saved stack */ uint8_t task_id; /* index in the task array */ __code char *name; /* task name */ @@ -55,8 +56,12 @@ extern __xdata struct ao_task *__data ao_cur_task; ao_task.c */ -/* Suspend the current task until wchan is awoken */ -void +/* Suspend the current task until wchan is awoken. + * returns: + * 0 on normal wake + * 1 on alarm + */ +uint8_t ao_sleep(__xdata void *wchan); /* Wake all tasks sleeping on wchan */ @@ -67,6 +72,10 @@ ao_wakeup(__xdata void *wchan); void ao_wake_task(__xdata struct ao_task *task); +/* set an alarm to go off in 'delay' ticks */ +void +ao_alarm(uint16_t delay); + /* Yield the processor to another task */ void ao_yield(void) _naked; @@ -356,7 +365,6 @@ ao_cmd_init(void); #define AO_DMA_DONE 1 #define AO_DMA_ABORTED 2 -#define AO_DMA_TIMEOUT 4 uint8_t ao_dma_alloc(__xdata uint8_t * done); @@ -380,7 +388,7 @@ ao_dma_trigger(uint8_t id); /* Abort a running DMA transfer */ void -ao_dma_abort(uint8_t id, uint8_t reason); +ao_dma_abort(uint8_t id); /* DMA interrupt routine */ void @@ -804,8 +812,12 @@ ao_telemetry_init(void); extern __xdata uint8_t ao_radio_dma; extern __xdata uint8_t ao_radio_dma_done; +extern __xdata uint8_t ao_radio_done; extern __xdata uint8_t ao_radio_mutex; +void +ao_radio_general_isr(void) interrupt 16; + void ao_radio_set_telemetry(void); @@ -831,7 +843,7 @@ void ao_radio_rdf(int ms); void -ao_radio_abort(uint8_t reason); +ao_radio_abort(void); void ao_radio_rdf_abort(void);