feat: Enhance RP2040 simulator GPIO handling to support InputPullUp state
This commit is contained in:
parent
083d8d69a8
commit
9c8e98cad2
|
|
@ -247,7 +247,7 @@ export class RP2040Simulator {
|
||||||
if (!gpio) continue;
|
if (!gpio) continue;
|
||||||
|
|
||||||
const unsub = gpio.addListener((state: GPIOPinState) => {
|
const unsub = gpio.addListener((state: GPIOPinState) => {
|
||||||
const isHigh = state === GPIOPinState.High;
|
const isHigh = state === GPIOPinState.High || state === GPIOPinState.InputPullUp;
|
||||||
this.pinManager.triggerPinChange(pin, isHigh);
|
this.pinManager.triggerPinChange(pin, isHigh);
|
||||||
if (this.onPinChangeWithTime && this.rp2040) {
|
if (this.onPinChangeWithTime && this.rp2040) {
|
||||||
// IClock interface exposes `nanos` (not `timeUs`)
|
// IClock interface exposes `nanos` (not `timeUs`)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue