wokwi / rp2040js

A Raspberry Pi Pico Emulator in JavaScript
MIT License
400 stars 44 forks source link

IRQ flags not set in the PIO INTR register #69

Closed urish closed 3 years ago

urish commented 3 years ago

The following test case passes on silicone but fails with the emulator:

  it('should update INTR after executing an `IRQ 2` instruction', async () => {
    await resetStateMachines();
    await cpu.writeUint32(IRQ, 0xff); // Clear all IRQs
    await cpu.writeUint32(SM2_INSTR, pioIRQ(false, false, 0x2));
    expect((await cpu.readUint32(INTR)) & 0xf00).toEqual(1 << 10);
  });