## Reboot on any key

While trying to implement the basics of USB, I got tired of continuously
toggling the safety DIP (reboot as ISP → reflash → reboot normally → it
doesn’t work as expected → repeat). Moreover, it is said that DIP
switches have a limited resource. Would be much easier if I could reboot
to ISP mode with a press of a key — we don’t have any use for them yet.

This is where the keypad interrupt comes in handy.

First, we set up the column pins as open-drain outputs:

```c
void keypad_init(void)
{
    P1M0 = 0xFF;
    P1M1 = 0xFF;
    P2M0 = 0xFF;
    P2M1 = 0xFF;
    P3M0 = 0x18;
    P3M0 = 0x18;
```

Then we activate all columns:

```c
    P1 = 0;
    P2 = 0;
    P3 &= 0xE7;
```

And set up the keypad interrupt to trigger when any row goes active:

```c
    KBMASK = 0xFF;
    KBPATN = 0xFF;
    KBCON &= ~PATN_SEL;
    AUXIE |= EKBI;
}
```

The interrupt handler will just reboot to ISP mode.

(While coding this change, I stumbled at the SDK manual calling a few
register bits with inconsistent names (`PATN_SEL` vs `PTNS`, `EKBI` vs
`EKB`). I added aliases for these bits.)