diff options
| author | Felipe Balbi <[email protected]> | 2025-11-19 09:11:54 -0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-11-19 09:11:54 -0800 |
| commit | a8eb124e47e633cd81e0863253d5f6bdd7545260 (patch) | |
| tree | 526374336411093886915121fea7245efa067c93 /src/clocks | |
| parent | ffe3e5acae6c0038db4176dc7d031b57f865e07f (diff) | |
OSTimer updates (#24)
* Initialize OSTIMER0 during HAL initialization
Provide the user with a working time driver.
Signed-off-by: Felipe Balbi <[email protected]>
* Handle time_driver interrupt internally
Signed-off-by: Felipe Balbi <[email protected]>
* Gate `time-driver` impl behind a `time` flag
Also prevents creation of an `Ostimer` instance if the `time`
feature is active.
* Remove some dead code
---------
Signed-off-by: Felipe Balbi <[email protected]>
Co-authored-by: James Munns <[email protected]>
Diffstat (limited to 'src/clocks')
| -rw-r--r-- | src/clocks/mod.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/clocks/mod.rs b/src/clocks/mod.rs index 558fb0278..a12e125c6 100644 --- a/src/clocks/mod.rs +++ b/src/clocks/mod.rs | |||
| @@ -867,7 +867,9 @@ macro_rules! impl_cc_gate { | |||
| 867 | /// This module contains implementations of MRCC APIs, specifically of the [`Gate`] trait, | 867 | /// This module contains implementations of MRCC APIs, specifically of the [`Gate`] trait, |
| 868 | /// for various low level peripherals. | 868 | /// for various low level peripherals. |
| 869 | pub(crate) mod gate { | 869 | pub(crate) mod gate { |
| 870 | use super::periph_helpers::{AdcConfig, LpuartConfig, NoConfig, OsTimerConfig}; | 870 | #[cfg(not(feature = "time"))] |
| 871 | use super::periph_helpers::OsTimerConfig; | ||
| 872 | use super::periph_helpers::{AdcConfig, LpuartConfig, NoConfig}; | ||
| 871 | use super::*; | 873 | use super::*; |
| 872 | 874 | ||
| 873 | // These peripherals have no additional upstream clocks or configuration required | 875 | // These peripherals have no additional upstream clocks or configuration required |
| @@ -888,7 +890,9 @@ pub(crate) mod gate { | |||
| 888 | 890 | ||
| 889 | // These peripherals DO have meaningful configuration, and could fail if the system | 891 | // These peripherals DO have meaningful configuration, and could fail if the system |
| 890 | // clocks do not match their needs. | 892 | // clocks do not match their needs. |
| 893 | #[cfg(not(feature = "time"))] | ||
| 891 | impl_cc_gate!(OSTIMER0, mrcc_glb_cc1, mrcc_glb_rst1, ostimer0, OsTimerConfig); | 894 | impl_cc_gate!(OSTIMER0, mrcc_glb_cc1, mrcc_glb_rst1, ostimer0, OsTimerConfig); |
| 895 | |||
| 892 | impl_cc_gate!(LPUART2, mrcc_glb_cc0, mrcc_glb_rst0, lpuart2, LpuartConfig); | 896 | impl_cc_gate!(LPUART2, mrcc_glb_cc0, mrcc_glb_rst0, lpuart2, LpuartConfig); |
| 893 | impl_cc_gate!(ADC1, mrcc_glb_cc1, mrcc_glb_rst1, adc1, AdcConfig); | 897 | impl_cc_gate!(ADC1, mrcc_glb_cc1, mrcc_glb_rst1, adc1, AdcConfig); |
| 894 | } | 898 | } |
