From 1c26eb722f7911737b7973982563a12bc3fb4164 Mon Sep 17 00:00:00 2001 From: Emil Fresk Date: Wed, 22 Feb 2023 19:59:50 +0100 Subject: [PATCH] Add template for bindings --- rtic-macros/src/codegen/bindings.rs | 4 +- rtic-macros/src/codegen/bindings/template.rs | 44 ++++++++++++++++++++ 2 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 rtic-macros/src/codegen/bindings/template.rs diff --git a/rtic-macros/src/codegen/bindings.rs b/rtic-macros/src/codegen/bindings.rs index 68378b5e7e..6c214cdb1f 100644 --- a/rtic-macros/src/codegen/bindings.rs +++ b/rtic-macros/src/codegen/bindings.rs @@ -1,7 +1,7 @@ #[cfg(not(any( feature = "cortex-m-source-masking", feature = "cortex-m-basepri", - feaute = "test-template" + feature = "test-template" )))] compile_error!("No backend selected"); @@ -9,7 +9,7 @@ compile_error!("No backend selected"); pub use cortex::*; #[cfg(feature = "test-template")] -pub use cortex::*; +pub use template::*; #[cfg(any(feature = "cortex-m-source-masking", feature = "cortex-m-basepri"))] mod cortex; diff --git a/rtic-macros/src/codegen/bindings/template.rs b/rtic-macros/src/codegen/bindings/template.rs new file mode 100644 index 0000000000..18f88fe0ad --- /dev/null +++ b/rtic-macros/src/codegen/bindings/template.rs @@ -0,0 +1,44 @@ +use crate::{ + analyze::Analysis as CodegenAnalysis, + syntax::{analyze::Analysis as SyntaxAnalysis, ast::App}, +}; +use proc_macro2::TokenStream as TokenStream2; +use quote::quote; +use syn::{parse, Attribute, Ident}; + +pub fn impl_mutex( + _app: &App, + _analysis: &CodegenAnalysis, + _cfgs: &[Attribute], + _resources_prefix: bool, + _name: &Ident, + _ty: &TokenStream2, + _ceiling: u8, + _ptr: &TokenStream2, +) -> TokenStream2 { + quote!() +} + +pub fn extra_assertions(_app: &App, _analysis: &SyntaxAnalysis) -> Vec { + vec![] +} + +pub fn pre_init_checks(_app: &App, _analysis: &SyntaxAnalysis) -> Vec { + vec![] +} + +pub fn pre_init_enable_interrupts(_app: &App, _analysis: &CodegenAnalysis) -> Vec { + vec![] +} + +pub fn architecture_specific_analysis(_app: &App, _analysis: &SyntaxAnalysis) -> parse::Result<()> { + Ok(()) +} + +pub fn interrupt_entry(_app: &App, _analysis: &CodegenAnalysis) -> Vec { + vec![] +} + +pub fn interrupt_exit(_app: &App, _analysis: &CodegenAnalysis) -> Vec { + vec![] +}