summaryrefslogtreecommitdiff
path: root/src/core/ao_task.c
Commit message (Collapse)AuthorAge
* altos: Rename 'core' to 'kernel'Keith Packard2014-04-05
| | | | | | | core remains a bad name to use -- dirvish skips files (and directories, it seems) with that name. Signed-off-by: Keith Packard <keithp@keithp.com>
* Merge remote-tracking branch 'origin/telemini'Keith Packard2013-08-28
|\ | | | | | | | | | | | | | | | | | | Signed-off-by: Keith Packard <keithp@keithp.com> Conflicts: src/core/ao_telemetry.c src/core/ao_telemetry.h Added both Mini and Metrum telemetry defines
| * altos: Make ao_wakeup reentrantKeith Packard2013-08-26
| | | | | | | | | | | | In case we end up invoking it from two places at once. Signed-off-by: Keith Packard <keithp@keithp.com>
* | altos: Update time for next alarm each time a task is addedKeith Packard2013-08-28
|/ | | | | | | | Adding a task with a sooner timeout than existing alarm tasks was not correctly updating the time to fire the next alarm, causing tasks to be delayed by the wrong amount. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Make stm-flash capable of switching to applicationKeith Packard2013-05-07
| | | | | | | This shrinks the base OS load down a bit as well so that stm-flash fits comfortably in the first 8kB of memory. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Use separate exception stack on STM32LKeith Packard2013-05-07
| | | | | | | | This reserves 512 bytes of memory for a stack, then makes sure that exceptions continue to use that stack while processes use the per-task stack. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add ao_task_minimize_latency to reduce IRQ delaysKeith Packard2012-11-30
| | | | | | | | | | | | | | When set, this causes the task switching code to avoid blocking IRQs while looking for an idle task as that can increase IRQ latencies enough to drop characters at 115200 baud on the cc1111. Note that this *also* eliminates the ability to use low power modes as we cannot know at any point whether some interrupt has come along and woken a task. Has no effect when using task queues as those require IRQs to be blocked while looking at the queue. Shouldn't be a problem there though as the check for no running tasks is very cheap. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Provide ao_task_alarm_tick to reduce per-tick costKeith Packard2012-10-26
| | | | | | | Cache the next wakeup time and check that before jumping to the task code. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Leave interrupts disabled while checking for task to runKeith Packard2012-10-26
| | | | | | | Otherwise, we run the risk of an interrupt waking a task after we've decided to idle the CPU. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add task queues.Keith Packard2012-10-25
| | | | | | | | | This replaces the array-based scheduler with a queue-based one instead. It should have the same basic scheduling semantics, but it walks shorter lists for each operation, making it much more efficient when the system has a lot of tasks. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add stack-guard code. Uses STM MPU to trap stack overflow.Keith Packard2012-10-25
| | | | | | | | This marks the lowest portion of the stack as inaccessible to the CPU, causing the processor to fault when it reaches it. The fault then generates a panic message so that the user can know what happened. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: profiling on STM32LKeith Packard2012-10-25
| | | | | | Add sample-based profiling, using a 1kHz timer Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Fix ao_delay function and move from per-chip code to ao_task.cKeith Packard2012-08-28
| | | | | | | ao_delay hasn't been chip-specific for a long time, and it had a bug in not calling ao_clear_alarm. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Make ao_cur_task_index track ao_cur_task in ao_yieldKeith Packard2012-08-26
| | | | | | | | This keeps the two main task references (index and pointer) in agreement during task switching, avoiding an extra assignment at the end of the task switching loop. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add debugging code to check for stack overflowKeith Packard2012-06-26
| | | | | | | | Stack overflow often happens from interrupt handlers sitting on top of a task stack. Check for this during ao_wakeup as that is often called during interrupt processing. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Don't lose IRQ disabled state in ao_sleepKeith Packard2012-06-17
| | | | | | | | | | | | Using ao_arch_critical around the wchan setting will force interrupts to be re-enabled before ao_yield records the state of that bit, potentially causing problems with functions not atomically testing and sleeping. Tasks that need to set wchan with interrupts disabled should have interrupts disabled when entering ao_sleep already. Signed-off-by: Keith Packard <keithp@keithp.com>
* Incorrect type in ao_task_info for wchanKeith Packard2012-03-28
| | | | | | Would truncate 32-bit pointers on arm. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Implement remote launch protocolKeith Packard2011-08-27
| | | | | | | | Uses the radio_cmac module to provide secure communication. Keeps igniter closed for 500ms. Provides remote status for arming and ignition. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: get avr-demo to build. Pull in AVR drivers and LCD driverKeith Packard2011-08-25
| | | | | | | This completes the basic task of making an AVR version of altos by getting the Teensy 'avr-demo' program to build. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: add GCC/SDCC compat macros, init_stack, save_context and GCC stdio hooksKeith Packard2011-08-25
| | | | | | | | | | | | | | More arch-indepdency bits. GCC stdio is different from SDCC, so create suitable code in avr/ao_avr_stdio.c Create macros to initialize the task stack frame and save the task context. Add GCC/SDCC type definition compatibility macros Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Restructure altos build to prepare for multi-arch supportKeith Packard2011-08-25
Split out sources into separate directories: core: architecture and product independent bits cc1111: cc1111-specific code drivers: architecture independent drivers product: product-specific sources and Makefile fragments util: scripts for building stuff This should have no effect on the built products, but testing is encouraged Signed-off-by: Keith Packard <keithp@keithp.com>