File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed 
src/rp2_common/hardware_pio/include/hardware Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -172,6 +172,9 @@ typedef pio_hw_t *PIO;
172172 */ 
173173#ifndef  PIO_NUM 
174174static_assert (PIO1_BASE  -  PIO0_BASE  ==  (1u  << 20 ), "hardware layout mismatch" );
175+ #if  NUM_PIOS  >  2 
176+ static_assert (PIO2_BASE  -  PIO0_BASE  ==  (2u  << 20 ), "hardware layout mismatch" );
177+ #endif 
175178#define  PIO_NUM (pio ) (((uintptr_t)(pio) - PIO0_BASE) >> 20)
176179#endif 
177180
@@ -185,6 +188,9 @@ static_assert(PIO1_BASE - PIO0_BASE == (1u << 20), "hardware layout mismatch");
185188 */ 
186189#ifndef  PIO_INSTANCE 
187190static_assert (PIO1_BASE  -  PIO0_BASE  ==  (1u  << 20 ), "hardware layout mismatch" );
191+ #if  NUM_PIOS  >  2 
192+ static_assert (PIO2_BASE  -  PIO0_BASE  ==  (2u  << 20 ), "hardware layout mismatch" );
193+ #endif 
188194#define  PIO_INSTANCE (instance ) ((pio_hw_t *)(PIO0_BASE + (instance) * (1u << 20)))
189195#endif 
190196
@@ -220,7 +226,7 @@ static_assert(DREQ_PIO1_RX0 == DREQ_PIO1_TX0 + NUM_PIO_STATE_MACHINES, "");
220226static_assert (DREQ_PIO2_TX0  ==  DREQ_PIO1_RX0  +  NUM_PIO_STATE_MACHINES , "" );
221227static_assert (DREQ_PIO2_RX0  ==  DREQ_PIO2_TX0  +  NUM_PIO_STATE_MACHINES , "" );
222228#endif 
223- #define  PIO_DREQ_NUM (pio , sm , is_tx ) ((sm) + (((is_tx) ? 0 : NUM_PIO_STATE_MACHINES) + PIO_NUM(pio) * (DREQ_PIO1_TX0 - DREQ_PIO0_TX0)))
229+ #define  PIO_DREQ_NUM (pio , sm , is_tx ) (DREQ_PIO0_TX0 +  (sm) + (((is_tx) ? 0 : NUM_PIO_STATE_MACHINES) + PIO_NUM(pio) * (DREQ_PIO1_TX0 - DREQ_PIO0_TX0)))
224230#endif 
225231
226232/** 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments