File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 35
35
features : ["rt"]
36
36
include :
37
37
- mcu : stm32f303xc
38
- features : rt,stm32-usbd
38
+ features : rt,stm32-usbd,can
39
39
steps :
40
40
- uses : actions/checkout@v2
41
41
- uses : actions-rs/toolchain@v1
65
65
with :
66
66
token : ${{ secrets.GITHUB_TOKEN }}
67
67
args : >
68
- --features=stm32f303xc,rt,stm32-usbd --lib --examples
68
+ --features=stm32f303xc,rt,stm32-usbd,can --lib --examples
69
69
-- -D warnings
70
70
71
71
rustfmt :
Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ fn main() -> ! {
81
81
}
82
82
83
83
let data: [ u8 ; 1 ] = [ counter] ;
84
- let frame = CanFrame :: data_frame ( CanId :: BaseId ( ID . into ( ) ) , & data) ;
84
+ let frame = CanFrame :: data_frame ( CanId :: BaseId ( ID ) , & data) ;
85
85
86
86
block ! ( can_tx. transmit( & frame) ) . expect ( "Cannot send CAN frame" ) ;
87
87
}
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ use nb::{self, Error};
17
17
18
18
use core:: sync:: atomic:: { AtomicU8 , Ordering } ;
19
19
20
- const EXID_MASK : u32 = 0b11111_11111100_00000000_00000000 ;
20
+ const EXID_MASK : u32 = 0b1_1111_1111_1100_0000_0000_0000_0000 ;
21
21
const MAX_EXTENDED_ID : u32 = 0x1FFF_FFFF ;
22
22
23
23
/// A CAN identifier, which can be either 11 or 27 (extended) bits.
@@ -302,7 +302,7 @@ impl Can {
302
302
_tx : self . _tx ,
303
303
} ;
304
304
305
- return ( transmitter, fifo0, fifo1) ;
305
+ ( transmitter, fifo0, fifo1)
306
306
}
307
307
308
308
pub fn free ( self ) -> ( stm32:: CAN , gpioa:: PA11 < AF9 > , gpioa:: PA12 < AF9 > ) {
@@ -353,7 +353,7 @@ impl embedded_hal_can::Transmitter for CanTransmitter {
353
353
} ) ,
354
354
}
355
355
356
- if let Some ( _ ) = frame. data ( ) {
356
+ if frame. data ( ) . is_some ( ) {
357
357
for j in 0 ..frame. data . len ( ) {
358
358
let val = & frame. data [ j] ;
359
359
You can’t perform that action at this time.
0 commit comments