@@ -185,35 +185,35 @@ macro_rules! algorithm {
185
185
#[ link_section = "DeviceData" ]
186
186
pub static FlashDevice : FlashDeviceDescription = FlashDeviceDescription {
187
187
// The version is never read by probe-rs and can be fixed.
188
- vers: 0x1 ,
188
+ vers: 0x1u16 . to_le ( ) ,
189
189
// The device name here can be customized but it really has no real use
190
190
// appart from identifying the device the ELF is intended for which we have
191
191
// in our YAML.
192
192
dev_name: $crate:: arrayify_string( $device_name) ,
193
193
// The specification does not specify the values that can go here,
194
194
// but this value means internal flash device.
195
- dev_type: $device_type,
196
- dev_addr: $flash_address,
197
- device_size: $flash_size,
198
- page_size: $page_size,
195
+ dev_type: ( $device_type as u16 ) . to_le ( ) ,
196
+ dev_addr: ( $flash_address as u32 ) . to_le ( ) ,
197
+ device_size: ( $flash_size as u32 ) . to_le ( ) ,
198
+ page_size: ( $page_size as u32 ) . to_le ( ) ,
199
199
_reserved: 0 ,
200
200
// The empty state of a byte in flash.
201
- empty: $empty_value,
201
+ empty: ( $empty_value as u8 ) . to_le ( ) ,
202
202
// This value can be used to estimate the amount of time the flashing procedure takes worst case.
203
- program_time_out: $program_time_out,
203
+ program_time_out: ( $program_time_out as u32 ) . to_le ( ) ,
204
204
// This value can be used to estimate the amount of time the erasing procedure takes worst case.
205
- erase_time_out: $erase_time_out,
205
+ erase_time_out: ( $erase_time_out as u32 ) . to_le ( ) ,
206
206
flash_sectors: [
207
207
$(
208
208
FlashSector {
209
- size: $size,
210
- address: $address,
209
+ size: ( $size as u32 ) . to_le ( ) ,
210
+ address: ( $address as u32 ) . to_le ( ) ,
211
211
}
212
212
) ,+,
213
213
// This marks the end of the flash sector list.
214
214
FlashSector {
215
- size: 0xffff_ffff ,
216
- address: 0xffff_ffff ,
215
+ size: 0xffff_ffffu32 . to_le ( ) ,
216
+ address: 0xffff_ffffu32 . to_le ( ) ,
217
217
}
218
218
] ,
219
219
} ;
@@ -222,7 +222,7 @@ macro_rules! algorithm {
222
222
pub struct FlashDeviceDescription {
223
223
vers: u16 ,
224
224
dev_name: [ u8 ; 128 ] ,
225
- dev_type: DeviceType ,
225
+ dev_type: u16 ,
226
226
dev_addr: u32 ,
227
227
device_size: u32 ,
228
228
page_size: u32 ,
0 commit comments