-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Macros no_enable_periph_rst_fn and similar
max78000-hal/hal/src/peripherals.rs
Lines 474 to 482 in 4d1d71d
| macro_rules! no_enable_rst_periph_fn { | |
| ($fn_name:ident, $p_type:ty, $field_name:ident) => { | |
| /// Gets the specified peripheral if not already taken elsewhere. Otherwise, | |
| /// returns [`BorrowMutError`]. | |
| pub fn $fn_name(&'a self) -> Result<PeripheralHandle<$p_type>, BorrowMutError> { | |
| PeripheralHandle::new(&self.$field_name) | |
| } | |
| }; | |
| } |
max78000-hal/hal/src/peripherals.rs
Lines 532 to 539 in 4d1d71d
| no_enable_rst_periph_fn!(timer_0, Clock<TMR>, timer_0); | |
| no_enable_rst_periph_fn!(timer_1, Clock<TMR1>, timer_1); | |
| no_enable_rst_periph_fn!(timer_2, Clock<TMR2>, timer_2); | |
| no_enable_rst_periph_fn!(timer_3, Clock<TMR3>, timer_3); | |
| no_enable_rst_periph_fn_no_handle!(gpio0, Gpio0, gpio0); | |
| no_enable_rst_periph_fn_no_handle!(gpio1, Gpio1, gpio1); | |
| no_enable_rst_periph_fn_no_handle!(gpio2, Gpio2, gpio2); |
currently generate methods of the type &'a self -> &Periph<'a, 'a, ...>, where PeripheralManager stores all registers with the same lifetime 'a
max78000-hal/hal/src/peripherals.rs
Line 509 in 4d1d71d
| pub struct PeripheralManager<'a> { |
We need to verify that this is the correct behavior.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels