Skip to content

Commit efa800b

Browse files
committed
add extra assertions to pio.h
1 parent c54475d commit efa800b

File tree

1 file changed

+4
-0
lines changed
  • src/rp2_common/hardware_pio/include/hardware

1 file changed

+4
-0
lines changed

src/rp2_common/hardware_pio/include/hardware/pio.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,10 @@ static_assert(DREQ_PIO0_TX2 == DREQ_PIO0_TX0 + 2, "");
215215
static_assert(DREQ_PIO0_TX3 == DREQ_PIO0_TX0 + 3, "");
216216
static_assert(DREQ_PIO0_RX0 == DREQ_PIO0_TX0 + NUM_PIO_STATE_MACHINES, "");
217217
static_assert(DREQ_PIO1_RX0 == DREQ_PIO1_TX0 + NUM_PIO_STATE_MACHINES, "");
218+
#if NUM_PIOS > 2
219+
static_assert(DREQ_PIO2_TX0 == DREQ_PIO1_RX0 + NUM_PIO_STATE_MACHINES, "");
220+
static_assert(DREQ_PIO2_RX0 == DREQ_PIO2_TX0 + NUM_PIO_STATE_MACHINES, "");
221+
#endif
218222
#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)))
219223
#endif
220224

0 commit comments

Comments
 (0)