aboutsummaryrefslogtreecommitdiff
path: root/macros/src/codegen/util.rs
diff options
context:
space:
mode:
authorGravatar Emil Fresk <emil.fresk@gmail.com> 2022-06-10 20:08:46 +0200
committerGravatar Emil Fresk <emil.fresk@gmail.com> 2022-08-03 11:30:32 +0200
commitb2ec1fa65118813b400cf806e3ff492ea41f49ca (patch)
treea9e9e71a7f696ad2832392054af12cc0019756d7 /macros/src/codegen/util.rs
parent13ccd92e630e2d2a477b5062a995a0fb1a2b7a28 (diff)
downloadrtic-b2ec1fa65118813b400cf806e3ff492ea41f49ca.tar.gz
rtic-b2ec1fa65118813b400cf806e3ff492ea41f49ca.tar.zst
rtic-b2ec1fa65118813b400cf806e3ff492ea41f49ca.zip
Example running, timeout and delay futures available
Diffstat (limited to 'macros/src/codegen/util.rs')
-rw-r--r--macros/src/codegen/util.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/macros/src/codegen/util.rs b/macros/src/codegen/util.rs
index 0a3edc20..a0a59090 100644
--- a/macros/src/codegen/util.rs
+++ b/macros/src/codegen/util.rs
@@ -67,6 +67,11 @@ pub fn inputs_ident(task: &Ident) -> Ident {
mark_internal_name(&format!("{}_INPUTS", task))
}
+/// Generates an identifier for the `EXECUTOR_RUN` atomics (`async` API)
+pub fn executor_run_ident(task: &Ident) -> Ident {
+ mark_internal_name(&format!("{}_EXECUTOR_RUN", task))
+}
+
/// Generates an identifier for the `INSTANTS` buffer (`schedule` API)
pub fn monotonic_instants_ident(task: &Ident, monotonic: &Ident) -> Ident {
mark_internal_name(&format!("{}_{}_INSTANTS", task, monotonic))
@@ -222,7 +227,7 @@ pub fn rq_ident(priority: u8) -> Ident {
/// Generates an identifier for the `enum` of `schedule`-able tasks
pub fn schedule_t_ident() -> Ident {
- Ident::new("SCHED_T", Span::call_site())
+ mark_internal_name("SCHED_T")
}
/// Generates an identifier for the `enum` of `spawn`-able tasks
@@ -230,7 +235,7 @@ pub fn schedule_t_ident() -> Ident {
/// This identifier needs the same structure as the `RQ` identifier because there's one ready queue
/// for each of these `T` enums
pub fn spawn_t_ident(priority: u8) -> Ident {
- Ident::new(&format!("P{}_T", priority), Span::call_site())
+ mark_internal_name(&format!("P{}_T", priority))
}
/// Suffixed identifier