22 Commits

Author SHA1 Message Date
Dániel Buga
69776eb638
Even more cargo-batch, encode configs in Cargo.toml (#4134)
* Abstract out LP-core targeting packages

* Encode targets_lp_core in Cargo.toml

* Encode architecture compatibility in Cargo.toml

* Move semver_checked into Cargo.toml

* Cache parsed tomls

* Parse simple feature sets from Cargo.toml

* Move all basic feature rules to Cargo.toml

* Add check configs

* Limit command length on Windows

* Update cargo.rs

* Add clippy configs

* Use a single syntax, use a single doc-config line

* Fix known problems

* Run cargo check in CI command

* Fix more problems

* Fix esp-storage
2025-09-18 16:15:35 +00:00
Dániel Buga
177e99fcef
Add TimerHandle::is_active (#4119) 2025-09-16 13:52:59 +00:00
Dániel Buga
9d596ca752
esp-radio: remove scheduler lifecycle management, remove idle task (#4093)
* Start scheduler on preempt init, remove deinit

* Static-allocate the main task context

* taskless idle

* Remove the need for an idle task
2025-09-15 12:47:39 +00:00
Dániel Buga
f41c86a902
Create timer task on demand (#4091) 2025-09-12 07:06:03 +00:00
Dániel Buga
ba2d541624
Some mild scheduler cleanup (#4096)
* Clean up arch-specific task code

* Avoid a few redundant unwraps in run_scheduler

* Pass TaskPtr to alarm callback

* Ensure the radio runs on the scheduler's core

* clippy

* Add warnings
2025-09-11 12:11:23 +00:00
Dániel Buga
cf80e6a8f1
Implement priority levels (#4090)
* Add priority to tasks

* Separate Mutex out of counting Semaphore

* Add priority inheritance to mutexes

* Test priority inheritance, fix issues

* Compare against the owner's current priority
2025-09-11 08:03:44 +00:00
Dániel Buga
35e208236a
Add wait queues to semaphore/queue (#4086)
* Add wait queue to semaphores

* Spawn idle task, prevent re-waking a ready task

* Add wait queues to queues

* Clean up wait queues

* Remove task from wait queue on timeout/resume

* Do not re-schedule deleted task

* Implement simple stack overflow detection

* Task deletion: remove task from queues in one place

* Fix storing context into freed memory

* Restore idle task stack size

* Undo alloc changes

* Don't let task sleep if wakeup time is in the past

* Improve codegen of esp_preempt_now
2025-09-10 07:24:25 +00:00
Dániel Buga
779f7a874f
esp-preempt: don't switch to sleeping tasks (#4081)
* Separate the alloc and run lists

* Replace circular task list with ready queue

* Remove separate SCHEDULER_STATE static

* Move scheduler to new file

* Reorganize, allow restarting scheduler

* Fix InternalMemory polyfill

* Use SingleShotTimer internally

* Implement a simple timer queue

* Extract run queue, wake tasks, store reason of scheduler event

* Add inherent function to get current task ptr

* Reimplement usleep with the timer queue

* Store current task in timer queue

* Sleep in timer queue task

* Remove ability to sleep arbitrary tasks

* More logging

* Clear timer interrupt in timer handler

* Even more logging

* Merge mutexes into semaphores
2025-09-09 09:57:35 +00:00
Dániel Buga
779228ef28
Tweak driver to better model FreeRTOS APIs (#4076) 2025-09-08 12:44:29 +00:00
Dániel Buga
445f6fc1ad
Add task priority to the preempt driver (#4064) 2025-09-05 16:30:16 +00:00
Dániel Buga
b9dd86258a
Add a function to retrieve a semaphore's counter value (#4066) 2025-09-05 15:37:41 +00:00
Dániel Buga
6dd0edd492
Teeny-tiny scheduler improvements (#4061)
* Avoid swapping to the same task

* Allow scheduling multiple tasks to be deleted

* Add task state
2025-09-05 15:01:17 +00:00
Dániel Buga
24d2122c14
Remove ConcurrentQueue & other minor tweaks (#4058)
* Remove ConcurrentQueue

* Unrequire preempt driver for 802.15.4
2025-09-05 14:59:08 +00:00
Dániel Buga
61ad37dd8e
Add timers to preempt (#4053)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-09-05 09:37:16 +00:00
Dániel Buga
a84d3cc89f
Make timekeeping the driver's job (#4047) 2025-09-05 07:31:40 +00:00
Dániel Buga
cf2b162517
Add queues to esp-preempt (#4043) 2025-09-04 15:26:51 +00:00
Dániel Buga
2e958d2bb7
Move mutexes to esp-preempt (#4041) 2025-09-04 07:38:43 +00:00
Dániel Buga
cc91bb1c9e
Move semaphore implementation to esp-preempt (#4038) 2025-09-03 14:21:47 +00:00
Dániel Buga
99e2b936df
Introduce esp-sync, avoid critical_section like the plague (#4023)
* Introduce esp-sync

* Avoid critical_section as much as possible
2025-09-03 09:34:18 +00:00
Juraj Sadel
e6cdd8eb3c
Add xtask command check-unused-deps and remove unused deps/features (#3967)
* Add xtask command check-unused-deps and remove unused deps/features

* fix changelog

* reviews, move check into nightly-ci

* reviews

* readd document-features to esp-preemt

* Just cargo machete
2025-08-27 08:48:58 +00:00
Juraj Sadel
68345293ed
More consistent naming of interrupt-related functions (#3933)
* More consistent naming of interrupt-related functions

* MG entry

* changelog

* use correct package for MG

* fix hil

* other drivers

* address review comments
2025-08-21 09:46:04 +00:00
Scott Mabin
7c944ec939
s/esp-radio-preempt-baremetal/esp-preempt/g (#3938)
* s/esp-radio-preempt-baremetal/esp-preempt/g

esp-preempt will hopefully one day be more useful than just a scheduler
for esp-radio, therefore I've removed the radio prefix for that future
goal. I also felt that baremetal didn't really add much other than
noise, so I've removed that postfix too.

* fix xtask

* remove test code

* fixups
2025-08-15 13:52:42 +00:00