@@ -30,7 +30,7 @@ fn panic(_info: &core::panic::PanicInfo) -> ! {
30
30
pub const FUNCTION_ERASE : u32 = 1 ;
31
31
pub const FUNCTION_PROGRAM : u32 = 2 ;
32
32
pub const FUNCTION_VERIFY : u32 = 3 ;
33
- pub const FUNCTION_BLANKCHECK : u32 = 4 ;
33
+ pub const FUNCTION_CUSTOMBLANKCHECK : u32 = 4 ;
34
34
35
35
pub type ErrorCode = core:: num:: NonZeroU32 ;
36
36
@@ -92,16 +92,16 @@ pub trait FlashAlgorithm: Sized + 'static {
92
92
///
93
93
/// * `address` - The start address of the flash to check.
94
94
/// * `size` - The length of the area to check.
95
- #[ cfg( feature = "blank-check" ) ]
96
- fn blank_check ( & mut self , address : u32 , size : u32 ) -> Result < ( ) , ErrorCode > ;
95
+ #[ cfg( feature = "custom- blank-check" ) ]
96
+ fn custom_blank_check ( & mut self , address : u32 , size : u32 ) -> Result < ( ) , ErrorCode > ;
97
97
}
98
98
99
99
#[ derive( Debug , Copy , Clone , PartialEq , Eq , Hash ) ]
100
100
pub enum Function {
101
101
Erase = 1 ,
102
102
Program = 2 ,
103
103
Verify = 3 ,
104
- BlankCheck = 4 ,
104
+ CustomBlankCheck = 4 ,
105
105
}
106
106
107
107
/// A macro to define a new flash algoritm.
@@ -142,7 +142,7 @@ macro_rules! algorithm {
142
142
1 => $crate:: Function :: Erase ,
143
143
2 => $crate:: Function :: Program ,
144
144
3 => $crate:: Function :: Verify ,
145
- 4 => $crate:: Function :: BlankCheck ,
145
+ 4 => $crate:: Function :: CustomBlankCheck ,
146
146
_ => core:: panic!( "This branch can only be reached if the host library sent an unknown function code." )
147
147
} ;
148
148
match <$type as $crate:: FlashAlgorithm >:: new( addr, clock, function) {
@@ -199,7 +199,7 @@ macro_rules! algorithm {
199
199
$crate:: erase_chip!( $type) ;
200
200
$crate:: read_flash!( $type) ;
201
201
$crate:: verify!( $type) ;
202
- $crate:: blank_check !( $type) ;
202
+ $crate:: custom_blank_check !( $type) ;
203
203
204
204
#[ allow( non_upper_case_globals) ]
205
205
#[ no_mangle]
@@ -374,25 +374,25 @@ macro_rules! verify {
374
374
375
375
#[ doc( hidden) ]
376
376
#[ macro_export]
377
- #[ cfg( not( feature = "blank-check" ) ) ]
378
- macro_rules! blank_check {
377
+ #[ cfg( not( feature = "custom- blank-check" ) ) ]
378
+ macro_rules! custom_blank_check {
379
379
( $type: ty) => { } ;
380
380
}
381
381
#[ doc( hidden) ]
382
382
#[ macro_export]
383
- #[ cfg( feature = "blank-check" ) ]
384
- macro_rules! blank_check {
383
+ #[ cfg( feature = "custom- blank-check" ) ]
384
+ macro_rules! custom_blank_check {
385
385
( $type: ty) => {
386
386
#[ no_mangle]
387
387
#[ link_section = ".entry" ]
388
- pub unsafe extern "C" fn BlankCheck ( addr: u32 , size: u32 ) -> u32 {
388
+ pub unsafe extern "C" fn CustomBlankCheck ( addr: u32 , size: u32 ) -> u32 {
389
389
let this = unsafe {
390
390
if !_IS_INIT {
391
391
return 1 ;
392
392
}
393
393
& mut * _ALGO_INSTANCE. as_mut_ptr( )
394
394
} ;
395
- match <$type as $crate:: FlashAlgorithm >:: blank_check ( this, addr, size) {
395
+ match <$type as $crate:: FlashAlgorithm >:: custom_blank_check ( this, addr, size) {
396
396
Ok ( ( ) ) => 0 ,
397
397
Err ( e) => e. get( ) ,
398
398
}
0 commit comments