Revision 38a34e1d hw/omap.c
b/hw/omap.c | ||
---|---|---|
2841 | 2841 |
int i; |
2842 | 2842 |
uint8_t *row, rows = 0, cols = ~s->cols; |
2843 | 2843 |
|
2844 |
for (row = s->buttons + 4, i = 1 << 5; i; row --, i >>= 1)
|
|
2844 |
for (row = s->buttons + 4, i = 1 << 4; i; row --, i >>= 1)
|
|
2845 | 2845 |
if (*row & cols) |
2846 |
s->row_latch |= i;
|
|
2846 |
rows |= i;
|
|
2847 | 2847 |
|
2848 |
if (rows && ~s->kbd_mask && s->clk) |
|
2849 |
qemu_irq_raise(s->kbd_irq); |
|
2848 |
qemu_set_irq(s->kbd_irq, rows && ~s->kbd_mask && s->clk); |
|
2850 | 2849 |
s->row_latch = rows ^ 0x1f; |
2851 | 2850 |
} |
2852 | 2851 |
|
... | ... | |
3002 | 3001 |
s->latch = 0; |
3003 | 3002 |
s->ints = 0; |
3004 | 3003 |
s->row_latch = 0x1f; |
3004 |
s->clk = 1; |
|
3005 | 3005 |
} |
3006 | 3006 |
|
3007 | 3007 |
static void omap_mpuio_onoff(void *opaque, int line, int on) |
... | ... | |
3056 | 3056 |
__FUNCTION__, col, row); |
3057 | 3057 |
|
3058 | 3058 |
if (down) |
3059 |
s->buttons[row] = 1 << col; |
|
3059 |
s->buttons[row] |= 1 << col;
|
|
3060 | 3060 |
else |
3061 |
s->buttons[row] = ~(1 << col); |
|
3061 |
s->buttons[row] &= ~(1 << col);
|
|
3062 | 3062 |
|
3063 | 3063 |
omap_mpuio_kbd_update(s); |
3064 | 3064 |
} |
Also available in: Unified diff