board/teensy40: Add I2C support (#1471)

* teensy40: add I2C support
This commit is contained in:
ardnew
2022-06-22 04:28:50 -05:00
committed by GitHub
parent 2825b4fe74
commit afae6b3795
4 changed files with 710 additions and 8 deletions
+4 -4
View File
@@ -342,10 +342,10 @@ func (jt *pinJumpTable) dispatchInterrupt(interrupt.Interrupt) {
if status := gpio.ISR.Get() & gpio.IMR.Get(); status != 0 {
gpio.ISR.Set(status) // clear interrupt
for status != 0 {
p := Pin(bits.TrailingZeros32(status))
i := Pin(port + p)
jt.lut[i](i)
status &^= 1 << p
off := Pin(bits.TrailingZeros32(status)) // ctz
pin := Pin(port + off)
jt.lut[pin](pin)
status &^= 1 << off
}
}
}