diff options
| author | Timo Kröger <[email protected]> | 2022-02-28 22:43:21 +0100 |
|---|---|---|
| committer | Timo Kröger <[email protected]> | 2022-03-05 09:46:06 +0100 |
| commit | 6929350552fcf3cc7cc830555ce09b16bb86746f (patch) | |
| tree | da9e23beec453b91cb4ed0147960cc3901f15e9d | |
| parent | 4c305439385c7be79dc9997ae8b698a3487aa819 (diff) | |
[can] Update macrotable comment
The chip description are corrected in:
https://github.com/embassy-rs/stm32-data/pull/123
| -rw-r--r-- | embassy-stm32/src/can/bxcan.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/embassy-stm32/src/can/bxcan.rs b/embassy-stm32/src/can/bxcan.rs index 33a729ed5..cb667695a 100644 --- a/embassy-stm32/src/can/bxcan.rs +++ b/embassy-stm32/src/can/bxcan.rs | |||
| @@ -92,15 +92,13 @@ foreach_peripheral!( | |||
| 92 | const NUM_FILTER_BANKS: u8 = 14; | 92 | const NUM_FILTER_BANKS: u8 = 14; |
| 93 | } | 93 | } |
| 94 | }; | 94 | }; |
| 95 | // Only correct when CAN2 also exists… Fix on yaml level? | 95 | // CAN1 and CAN2 is a combination of master and slave instance. |
| 96 | // There are only 14 filter banks when CAN2 is not available. | 96 | // CAN1 owns the filter bank and needs to be enabled in order |
| 97 | // for CAN2 to receive messages. | ||
| 97 | (can, CAN1) => { | 98 | (can, CAN1) => { |
| 98 | unsafe impl bxcan::FilterOwner for peripherals::CAN1 { | 99 | unsafe impl bxcan::FilterOwner for peripherals::CAN1 { |
| 99 | const NUM_FILTER_BANKS: u8 = 28; | 100 | const NUM_FILTER_BANKS: u8 = 28; |
| 100 | } | 101 | } |
| 101 | }; | ||
| 102 | (can, CAN2) => { | ||
| 103 | // CAN2 is always a slave instance where CAN1 is the master instance | ||
| 104 | unsafe impl bxcan::MasterInstance for peripherals::CAN1 {} | 102 | unsafe impl bxcan::MasterInstance for peripherals::CAN1 {} |
| 105 | }; | 103 | }; |
| 106 | (can, CAN3) => { | 104 | (can, CAN3) => { |
