3535
3636fn alloc_frame ( id : Id , data : & [ u8 ] ) -> Box < CanFramePool , Init > {
3737 let frame_box = CanFramePool :: alloc ( ) . unwrap ( ) ;
38- frame_box. init ( Frame :: new ( id, data) )
38+ frame_box. init ( Frame :: new ( id, data) . unwrap ( ) )
3939}
4040
4141#[ app( device = stm32f1xx_hal:: pac, peripherals = true ) ]
@@ -90,10 +90,10 @@ const APP: () = {
9090 #[ cfg( feature = "connectivity" ) ]
9191 let ( mut filters, _) = can. split_filters ( 0 ) . unwrap ( ) ;
9292 filters
93- . add ( & Filter :: new_standard ( 0 ) . with_mask ( 0 ) . allow_remote ( ) )
93+ . add ( & Filter :: new ( Id :: Standard ( 0 ) ) . with_mask ( 0 ) . allow_remote ( ) )
9494 . unwrap ( ) ;
9595 filters
96- . add ( & Filter :: new_extended ( 0 ) . with_mask ( 0 ) . allow_remote ( ) )
96+ . add ( & Filter :: new ( Id :: Extended ( 0 ) ) . with_mask ( 0 ) . allow_remote ( ) )
9797 . unwrap ( ) ;
9898
9999 let mut can_rx = can. take_rx ( filters) . unwrap ( ) ;
@@ -123,25 +123,25 @@ const APP: () = {
123123 // Enqueue some messages. Higher ID means lower priority.
124124 tx_queue. lock ( |tx_queue| {
125125 tx_queue
126- . push ( alloc_frame ( Id :: new_standard ( 9 ) , & [ 0 , 1 , 2 , 4 ] ) )
126+ . push ( alloc_frame ( Id :: Standard ( 9 ) , & [ 0 , 1 , 2 , 4 ] ) )
127127 . unwrap ( ) ;
128128 tx_queue
129- . push ( alloc_frame ( Id :: new_standard ( 9 ) , & [ 0 , 1 , 2 , 4 ] ) )
129+ . push ( alloc_frame ( Id :: Standard ( 9 ) , & [ 0 , 1 , 2 , 4 ] ) )
130130 . unwrap ( ) ;
131131 tx_queue
132- . push ( alloc_frame ( Id :: new_standard ( 8 ) , & [ 0 , 1 , 2 , 4 ] ) )
132+ . push ( alloc_frame ( Id :: Standard ( 8 ) , & [ 0 , 1 , 2 , 4 ] ) )
133133 . unwrap ( ) ;
134134
135135 // Extended frames have lower priority than standard frames.
136136 tx_queue
137- . push ( alloc_frame ( Id :: new_extended ( 8 ) , & [ 0 , 1 , 2 , 4 ] ) )
137+ . push ( alloc_frame ( Id :: Extended ( 8 ) , & [ 0 , 1 , 2 , 4 ] ) )
138138 . unwrap ( ) ;
139139 tx_queue
140- . push ( alloc_frame ( Id :: new_extended ( 7 ) , & [ 0 , 1 , 2 , 4 ] ) )
140+ . push ( alloc_frame ( Id :: Extended ( 7 ) , & [ 0 , 1 , 2 , 4 ] ) )
141141 . unwrap ( ) ;
142142
143143 tx_queue
144- . push ( alloc_frame ( Id :: new_standard ( 7 ) , & [ 0 , 1 , 2 , 4 ] ) )
144+ . push ( alloc_frame ( Id :: Standard ( 7 ) , & [ 0 , 1 , 2 , 4 ] ) )
145145 . unwrap ( ) ;
146146 } ) ;
147147
@@ -155,13 +155,13 @@ const APP: () = {
155155 if tx_count >= 3 {
156156 tx_queue. lock ( |tx_queue| {
157157 tx_queue
158- . push ( alloc_frame ( Id :: new_standard ( 3 ) , & [ 0 , 1 , 2 , 4 ] ) )
158+ . push ( alloc_frame ( Id :: Standard ( 3 ) , & [ 0 , 1 , 2 , 4 ] ) )
159159 . unwrap ( ) ;
160160 tx_queue
161- . push ( alloc_frame ( Id :: new_standard ( 2 ) , & [ 0 , 1 , 2 , 4 ] ) )
161+ . push ( alloc_frame ( Id :: Standard ( 2 ) , & [ 0 , 1 , 2 , 4 ] ) )
162162 . unwrap ( ) ;
163163 tx_queue
164- . push ( alloc_frame ( Id :: new_standard ( 1 ) , & [ 0 , 1 , 2 , 4 ] ) )
164+ . push ( alloc_frame ( Id :: Standard ( 1 ) , & [ 0 , 1 , 2 , 4 ] ) )
165165 . unwrap ( ) ;
166166 } ) ;
167167 break ;
0 commit comments