Device macro to generate stateful and publish variants of device specific poll inputs.
This commit is contained in:
@ -176,14 +176,14 @@ pub fn poll_variant_macro(input: TokenStream) -> TokenStream {
|
||||
}
|
||||
|
||||
// ----- Publish struct ----------------------------------
|
||||
//#[cfg(feature = "embassy-sync")]
|
||||
#[cfg(feature = "embassy-sync")]
|
||||
#vis struct #publish_variant_ident #publish_generics #publ_where_clause {
|
||||
pub poll: #ident #og_type_generics,
|
||||
pub publisher: #publisher_path<#value_type_ident, #mutex_t_ident, #capacity_ident, #num_subs_ident>,
|
||||
}
|
||||
|
||||
// ----- Publish impl ----------------------------------
|
||||
//#[cfg(feature = "embassy-sync")]
|
||||
#[cfg(feature = "embassy-sync")]
|
||||
impl #publ_impl_generics #poll_path for #publish_variant_ident #publ_type_generics #publ_where_clause {
|
||||
type Value = #value_type_ident;
|
||||
|
||||
@ -195,7 +195,7 @@ pub fn poll_variant_macro(input: TokenStream) -> TokenStream {
|
||||
}
|
||||
}
|
||||
|
||||
//#[cfg(feature = "embassy-sync")]
|
||||
#[cfg(feature = "embassy-sync")]
|
||||
impl #publ_impl_generics #publish_path<#capacity_ident, #num_subs_ident> for #publish_variant_ident #publ_type_generics #publ_where_clause {
|
||||
type Value = #value_type_ident;
|
||||
type Mutex = #mutex_t_ident;
|
||||
@ -209,14 +209,14 @@ pub fn poll_variant_macro(input: TokenStream) -> TokenStream {
|
||||
}
|
||||
|
||||
// ----- StatePub struct ----------------------------------
|
||||
//#[cfg(feature = "embassy-sync")]
|
||||
#[cfg(feature = "embassy-sync")]
|
||||
#vis struct #state_pub_variant_ident #publish_generics #publ_where_clause {
|
||||
pub poll: #ident #og_type_generics,
|
||||
pub state: #state_path<#value_type_ident>,
|
||||
pub publisher: #publisher_path<#value_type_ident, #mutex_t_ident, #capacity_ident, #num_subs_ident>,
|
||||
}
|
||||
|
||||
//#[cfg(feature = "embassy-sync")]
|
||||
#[cfg(feature = "embassy-sync")]
|
||||
impl #publ_impl_generics #poll_path for #state_pub_variant_ident #publ_type_generics #publ_where_clause {
|
||||
type Value = #value_type_ident;
|
||||
|
||||
@ -229,7 +229,7 @@ pub fn poll_variant_macro(input: TokenStream) -> TokenStream {
|
||||
}
|
||||
}
|
||||
|
||||
//#[cfg(feature = "embassy-sync")]
|
||||
#[cfg(feature = "embassy-sync")]
|
||||
impl #publ_impl_generics #stateful_path for #state_pub_variant_ident #publ_type_generics #publ_where_clause {
|
||||
type Value = #value_type_ident;
|
||||
|
||||
@ -244,7 +244,7 @@ pub fn poll_variant_macro(input: TokenStream) -> TokenStream {
|
||||
}
|
||||
}
|
||||
|
||||
//#[cfg(feature = "embassy-sync")]
|
||||
#[cfg(feature = "embassy-sync")]
|
||||
impl #publ_impl_generics #publish_path<#capacity_ident, #num_subs_ident> for #state_pub_variant_ident #publ_type_generics #publ_where_clause {
|
||||
type Value = #value_type_ident;
|
||||
type Mutex = #mutex_t_ident;
|
||||
|
Reference in New Issue
Block a user