diff options
| author | Corey Schuhen <[email protected]> | 2024-02-25 08:57:18 +1000 |
|---|---|---|
| committer | Corey Schuhen <[email protected]> | 2024-02-25 10:14:12 +1000 |
| commit | 0565098b06f73b542369c4d4f97f34c78e9bd058 (patch) | |
| tree | 3674160007c87a0b7a015c1ec11b40e006a12f52 | |
| parent | a061cf31334d7c1912528edecb4738c84d98e17a (diff) | |
FDCAN: Fix some indenting in macros
| -rw-r--r-- | embassy-stm32/src/can/fdcan.rs | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/embassy-stm32/src/can/fdcan.rs b/embassy-stm32/src/can/fdcan.rs index d290295f5..4b76cc34d 100644 --- a/embassy-stm32/src/can/fdcan.rs +++ b/embassy-stm32/src/can/fdcan.rs | |||
| @@ -929,22 +929,22 @@ macro_rules! impl_fdcan { | |||
| 929 | unsafe { peripherals::$inst::mut_state() } | 929 | unsafe { peripherals::$inst::mut_state() } |
| 930 | } | 930 | } |
| 931 | 931 | ||
| 932 | #[cfg(feature = "time")] | 932 | #[cfg(feature = "time")] |
| 933 | fn calc_timestamp(ns_per_timer_tick: u64, ts_val: u16) -> Timestamp { | 933 | fn calc_timestamp(ns_per_timer_tick: u64, ts_val: u16) -> Timestamp { |
| 934 | let now_embassy = embassy_time::Instant::now(); | 934 | let now_embassy = embassy_time::Instant::now(); |
| 935 | if ns_per_timer_tick == 0 { | 935 | if ns_per_timer_tick == 0 { |
| 936 | return now_embassy; | 936 | return now_embassy; |
| 937 | } | 937 | } |
| 938 | let cantime = { Self::regs().tscv().read().tsc() }; | 938 | let cantime = { Self::regs().tscv().read().tsc() }; |
| 939 | let delta = cantime.overflowing_sub(ts_val).0 as u64; | 939 | let delta = cantime.overflowing_sub(ts_val).0 as u64; |
| 940 | let ns = ns_per_timer_tick * delta as u64; | 940 | let ns = ns_per_timer_tick * delta as u64; |
| 941 | now_embassy - embassy_time::Duration::from_nanos(ns) | 941 | now_embassy - embassy_time::Duration::from_nanos(ns) |
| 942 | } | 942 | } |
| 943 | 943 | ||
| 944 | #[cfg(not(feature = "time"))] | 944 | #[cfg(not(feature = "time"))] |
| 945 | fn calc_timestamp(_ns_per_timer_tick: u64, ts_val: u16) -> Timestamp { | 945 | fn calc_timestamp(_ns_per_timer_tick: u64, ts_val: u16) -> Timestamp { |
| 946 | ts_val | 946 | ts_val |
| 947 | } | 947 | } |
| 948 | 948 | ||
| 949 | } | 949 | } |
| 950 | 950 | ||
