@@ -32,7 +32,7 @@ fn gpio_version_to_feature(version: &str) -> Result<String, String> {
32
32
}
33
33
}
34
34
35
- /// Get the EEPROM size (in KiB) feature for a certain size.
35
+ /// Get the EEPROM size feature for a certain size.
36
36
fn eeprom_size_to_feature ( size : u32 ) -> String {
37
37
format ! ( "eeprom-{}" , size)
38
38
}
@@ -102,7 +102,7 @@ fn main() -> Result<(), String> {
102
102
103
103
// EEPROM size map
104
104
//
105
- // The keys of this map are EEPROM sizes in KiB , the values are Vecs of MCU ref names.
105
+ // The keys of this map are EEPROM sizes, the values are Vecs of MCU ref names.
106
106
let mut mcu_eeprom_size_map: HashMap < u32 , Vec < String > > = HashMap :: new ( ) ;
107
107
108
108
// Iterate through subfamilies, then through MCUs. Fill the maps above with
@@ -127,7 +127,7 @@ fn main() -> Result<(), String> {
127
127
}
128
128
129
129
// Fill EEPROM size map
130
- if let Some ( size) = mcu_dat. get_eeprom_size_kib ( ) {
130
+ if let Some ( size) = mcu_dat. get_eeprom_size ( ) {
131
131
mcu_eeprom_size_map
132
132
. entry ( size)
133
133
. or_insert ( vec ! [ ] )
@@ -200,7 +200,7 @@ fn generate_features(
200
200
// EEPROM sizes
201
201
let mut eeprom_sizes = mcu_eeprom_size_map. keys ( ) . collect :: < Vec < _ > > ( ) ;
202
202
eeprom_sizes. sort ( ) ;
203
- println ! ( "# Features based on EEPROM size (in KiB )" ) ;
203
+ println ! ( "# Features based on EEPROM size (in bytes )" ) ;
204
204
for size in eeprom_sizes {
205
205
println ! ( "{} = []" , eeprom_size_to_feature( * size) ) ;
206
206
}
@@ -247,7 +247,7 @@ fn generate_features(
247
247
dependencies. push ( gpio_version_feature. clone ( ) ) ;
248
248
249
249
// EEPROM size
250
- if let Some ( size) = mcu_map. get ( mcu) . unwrap ( ) . get_eeprom_size_kib ( ) {
250
+ if let Some ( size) = mcu_map. get ( mcu) . unwrap ( ) . get_eeprom_size ( ) {
251
251
dependencies. push ( eeprom_size_to_feature ( size) ) ;
252
252
}
253
253
@@ -301,10 +301,10 @@ fn generate_pin_mappings(
301
301
302
302
/// Generate code containing the EEPROM size.
303
303
fn generate_eeprom_sizes ( mcu_eeprom_size_map : & HashMap < u32 , Vec < String > > ) -> Result < ( ) , String > {
304
- println ! ( "// EEPROM sizes in KiB , generated with cube-parse" ) ;
304
+ println ! ( "// EEPROM sizes in bytes , generated with cube-parse" ) ;
305
305
for size in mcu_eeprom_size_map. keys ( ) {
306
306
println ! ( "#[cfg({})]" , eeprom_size_to_feature( * size) ) ;
307
- println ! ( "const EEPROM_SIZE_KIB : u32 = {};" , size) ;
307
+ println ! ( "const EEPROM_SIZE_BYTES : u32 = {};" , size) ;
308
308
}
309
309
Ok ( ( ) )
310
310
}
0 commit comments