altos: Rename 'core' to 'kernel' 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' 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: Update time for next alarm each time a task is added 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 ao_wakeup reentrant In case we end up invoking it from two places at once. Signed-off-by: Keith Packard <keithp@keithp.com>
altos: Make stm-flash capable of switching to application 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 STM32L 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 delays 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 cost 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 run 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. 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. 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 STM32L 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.c 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_yield 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 overflow 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_sleep 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 wchan Would truncate 32-bit pointers on arm. Signed-off-by: Keith Packard <keithp@keithp.com>
altos: Implement remote launch protocol 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 driver 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 hooks 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>