@@ -290,12 +290,12 @@ pub enum SoftwareTimeout {
290290#[ instability:: unstable]
291291#[ derive( Debug , Clone , Copy , PartialEq , Eq , Hash ) ]
292292#[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
293- #[ cfg( not ( any ( esp32 , esp32s2 ) ) ) ]
293+ #[ cfg( i2c_master_has_fsm_timeouts ) ]
294294pub struct FsmTimeout {
295295 value : u8 ,
296296}
297297
298- #[ cfg( not ( any ( esp32 , esp32s2 ) ) ) ]
298+ #[ cfg( i2c_master_has_fsm_timeouts ) ]
299299impl FsmTimeout {
300300 const FSM_TIMEOUT_MAX : u8 = 23 ;
301301
@@ -331,7 +331,7 @@ impl FsmTimeout {
331331 }
332332}
333333
334- #[ cfg( not ( any ( esp32 , esp32s2 ) ) ) ]
334+ #[ cfg( i2c_master_has_fsm_timeouts ) ]
335335impl Default for FsmTimeout {
336336 fn default ( ) -> Self {
337337 Self :: new_const :: < { Self :: FSM_TIMEOUT_DEFAULT } > ( )
@@ -596,14 +596,14 @@ pub struct Config {
596596 /// Sets the threshold value for the unchanged period of the SCL_FSM.
597597 ///
598598 /// Default value: 16.
599- #[ cfg( not ( any ( esp32 , esp32s2 ) ) ) ]
599+ #[ cfg( i2c_master_has_fsm_timeouts ) ]
600600 #[ builder_lite( unstable) ]
601601 scl_st_timeout : FsmTimeout ,
602602
603603 /// Sets the threshold for the unchanged duration of the SCL_MAIN_FSM.
604604 ///
605605 /// Default value: 16.
606- #[ cfg( not ( any ( esp32 , esp32s2 ) ) ) ]
606+ #[ cfg( i2c_master_has_fsm_timeouts ) ]
607607 #[ builder_lite( unstable) ]
608608 scl_main_st_timeout : FsmTimeout ,
609609}
@@ -614,9 +614,9 @@ impl Default for Config {
614614 frequency : Rate :: from_khz ( 100 ) ,
615615 timeout : BusTimeout :: BusCycles ( 10 ) ,
616616 software_timeout : SoftwareTimeout :: PerByte ( Duration :: from_millis ( 1 ) ) ,
617- #[ cfg( not ( any ( esp32 , esp32s2 ) ) ) ]
617+ #[ cfg( i2c_master_has_fsm_timeouts ) ]
618618 scl_st_timeout : Default :: default ( ) ,
619- #[ cfg( not ( any ( esp32 , esp32s2 ) ) ) ]
619+ #[ cfg( i2c_master_has_fsm_timeouts ) ]
620620 scl_main_st_timeout : Default :: default ( ) ,
621621 }
622622 }
@@ -1540,7 +1540,7 @@ impl Driver<'_> {
15401540 self . set_frequency ( config) ?;
15411541
15421542 // Configure additional timeouts
1543- #[ cfg( not ( any ( esp32 , esp32s2 ) ) ) ]
1543+ #[ cfg( i2c_master_has_fsm_timeouts ) ]
15441544 {
15451545 self . regs ( )
15461546 . scl_st_time_out ( )
@@ -2236,7 +2236,7 @@ impl Driver<'_> {
22362236 ) ) ;
22372237 }
22382238
2239- #[ cfg( not ( any ( esp32 , esp32s2 ) ) ) ]
2239+ #[ cfg( i2c_master_has_fsm_timeouts ) ]
22402240 {
22412241 if r. scl_st_to ( ) . bit_is_set ( ) {
22422242 return Err ( Error :: Timeout ) ;
@@ -2817,7 +2817,7 @@ fn calculate_chunk_size(remaining: usize) -> usize {
28172817 }
28182818}
28192819
2820- #[ cfg( not ( any ( esp32 , esp32s2 ) ) ) ]
2820+ #[ cfg( i2c_master_has_hw_bus_clear ) ]
28212821mod bus_clear {
28222822 use super :: * ;
28232823
@@ -2868,7 +2868,7 @@ mod bus_clear {
28682868 }
28692869}
28702870
2871- #[ cfg( any ( esp32 , esp32s2 ) ) ]
2871+ #[ cfg( not ( i2c_master_has_hw_bus_clear ) ) ]
28722872mod bus_clear {
28732873 use super :: * ;
28742874 use crate :: gpio:: AnyPin ;
0 commit comments