Small doc/example changes

* Use PIO IRQ accessors in PIO I2C example

* Update pio/ir_nec/README.adoc file links (#183)

The "List of Files" now links (only) to files, not to directories (which prevented this example being included in the C SDK databook)
This commit is contained in:
Graham Sanderson
2021-11-24 19:02:20 -06:00
committed by GitHub
parent 188d849b1f
commit afd1d2008f
4 changed files with 22 additions and 22 deletions

View File

@@ -108,10 +108,11 @@ static inline void i2c_program_init(PIO pio, uint sm, uint offset, uint pin_sda,
gpio_set_oeover(pin_scl, GPIO_OVERRIDE_INVERT);
pio_sm_set_pins_with_mask(pio, sm, 0, both_pins);
// Clear IRQ flag before starting
hw_clear_bits(&pio->inte0, 1u << sm);
hw_clear_bits(&pio->inte1, 1u << sm);
pio->irq = 1u << sm;
// Clear IRQ flag before starting, and make sure flag doesn't actually
// assert a system-level interrupt (we're using it as a status flag)
pio_set_irq0_source_enabled(pio, pis_interrupt0 + sm, false);
pio_set_irq1_source_enabled(pio, pis_interrupt0 + sm, false);
pio_interrupt_clear(pio, sm);
// Configure and start SM
pio_sm_init(pio, sm, offset + i2c_offset_entry_point, &c);