forked from ProjectZeroSlackr/ipodloader2
-
Notifications
You must be signed in to change notification settings - Fork 1
/
keypad.c
624 lines (524 loc) · 16.9 KB
/
keypad.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
#include "bootloader.h"
#include "minilibc.h"
#include "fb.h"
#include "ipodhw.h"
#include "interrupts.h"
#include "console.h"
#include "keypad.h"
static uint8 kbd_state = 0;
static int ipod_hw_ver;
static uint8 kbdbuf[4];
static int kbdbufelems = 0;
static void kbd_poll ();
uint8 keypad_getstate(void) {
if (!irqs_enabled()) kbd_poll ();
return kbd_state;
}
int isHoldEngaged (void)
{
if (!irqs_enabled()) kbd_poll ();
return (kbd_state & 0x20) != 0;
}
void keypad_flush(void)
{
do {} while (keypad_getkey ());
}
int keypad_getkey(void)
// fetch a key from the buffer
{
int i, key = 0;
if (!irqs_enabled()) kbd_poll ();
if (kbdbufelems > 0) {
key = kbdbuf[0];
--kbdbufelems;
for (i = 0; i < kbdbufelems; ++i) {
kbdbuf[i] = kbdbuf[i+1];
}
}
return key;
}
static void add_keypress (uint8 key)
// add key to buffer
{
if (key) {
if (kbdbufelems < sizeof(kbdbuf)) {
kbdbuf[kbdbufelems++] = key;
}
}
}
static uint8 kbdcode_to_key (int code)
{
if (code & IPOD_KEYPAD_SCRR) return IPOD_KEY_FWD;
if (code & IPOD_KEYPAD_NEXT) return IPOD_KEY_FWD;
if (code & IPOD_KEYPAD_PLAY) return IPOD_KEY_PLAY;
if (code & IPOD_KEYPAD_SCRL) return IPOD_KEY_REW;
if (code & IPOD_KEYPAD_PREV) return IPOD_KEY_REW;
if (code & IPOD_KEYPAD_MENU) return IPOD_KEY_MENU;
if (code & IPOD_KEYPAD_ACTION) return IPOD_KEY_SELECT;
// HOLD generates no key - use isHoldEngaged() instead
return 0;
}
#define R_SC IPOD_KEYPAD_SCRR
#define L_SC IPOD_KEYPAD_SCRL
#define UP_SC IPOD_KEYPAD_MENU
#define LEFT_SC IPOD_KEYPAD_PREV
#define RIGHT_SC IPOD_KEYPAD_NEXT
#define DOWN_SC IPOD_KEYPAD_PLAY
#define HOLD_SC IPOD_KEYPAD_HOLD
#define ACTION_SC IPOD_KEYPAD_ACTION
static int last_code = 0;
static int do_clicks_fwd = 0;
static int do_clicks_rew = 0;
static void handle_scancode (uint8 code, uint8 down)
{
if (down) {
uint8 key = kbdcode_to_key (code);
if (code == IPOD_KEYPAD_HOLD) {
// since 1G and 2G models do not block the other keys in hardware, we'll do it here in software
kbd_state = code; // this clears any other keys
} else {
kbd_state |= code;
}
add_keypress (key);
if (code == R_SC || code == L_SC) {
if (key == IPOD_KEY_FWD) {
if (do_clicks_fwd-- > 0) ipod_beep (0, 0); // makes click sound
} else if (key == IPOD_KEY_REW) {
if (do_clicks_rew-- > 0) ipod_beep (0, 0); // makes click sound
}
}
} else {
kbd_state &= ~code;
}
last_code = code;
}
static void check_key (uint8 source, uint8 state, uint8 mask, uint8 code)
{
if (source & mask) {
handle_scancode (code, !(state & mask));
}
}
static void handle_scroll_wheel(int new_scroll, int reverse)
{
static int prev_scroll = -1;
static int action_count;
static signed char scroll_state[4][4] = {
{0, 1, -1, 0},
{-1, 0, 0, 1},
{1, 0, 0, -1},
{0, -1, 1, 0}
};
if ( prev_scroll >= 0 && new_scroll >= 0 ) {
signed char state = scroll_state[prev_scroll][new_scroll];
if (state) {
uint8 key;
if ((state > 0) == (reverse != 0)) {
key = R_SC;
} else {
key = L_SC;
}
if (last_code != key) {
action_count = 5; // we want that many wheel actions to register a key
last_code = key;
} else if (--action_count == 0) {
handle_scancode (key, 1);
handle_scancode (key, 0);
last_code = 0; // start counting again
}
}
}
prev_scroll = new_scroll;
}
/*
* -----------------------------------------------------------------------
* Interrupt Handling
* -----------------------------------------------------------------------
*/
#define KEYBOARD_DEV_ID (void *)0x4b455942 // need to pass something because we use a shared irq
static uint8 was_hold = 0;
static int last_source, last_state;
static void process_keys_5002 (uint8 source)
{
uint8 state;
// get current keypad status
state = inb(IPOD_PP5002_GPIOA_INPUT_VAL);
outb(~state, IPOD_PP5002_GPIOA_INT_LEV);
last_source = source;
last_state = state;
if (ipod_hw_ver == 0x3) {
if (was_hold && source == 0x40) {
// debounce HOLD release (TT has no idea why this works, though)
goto finish;
}
was_hold = 0;
}
if (source & IPOD_KEYPAD_HOLD) {
if (ipod_hw_ver == 0x3) {
// 3g hold switch is active low
if (state & IPOD_KEYPAD_HOLD) {
handle_scancode (HOLD_SC, 0);
handle_scroll_wheel (-1, 0); // reset
was_hold = 1;
} else {
handle_scancode (HOLD_SC, 1);
state = 0x1f; // clear all keys
}
} else {
handle_scancode (HOLD_SC, (state & 0x20));
handle_scroll_wheel (-1, 0); // reset
}
}
if (!(kbd_state & HOLD_SC)) {
check_key (source, state, 0x01, RIGHT_SC);
check_key (source, state, 0x02, ACTION_SC);
check_key (source, state, 0x04, DOWN_SC);
check_key (source, state, 0x08, LEFT_SC);
check_key (source, state, 0x10, UP_SC);
if (source & 0xc0) {
handle_scroll_wheel ((state >> 6) & 3, 0);
}
}
finish:
// ack any active interrupts
outb(source, IPOD_PP5002_GPIOA_INT_CLR);
}
static void kbd_intr_5002 (int irq, void *dev_id, struct pt_regs *regs)
{
uint8 source;
// we need some delay for g3, cause hold generates several interrupts, some of them delayed
if (ipod_hw_ver == 0x3) mlc_delay_us(250);
// get source of interupts
source = inb(IPOD_PP5002_GPIOA_INT_STAT);
if (source == 0) return; // not for us
process_keys_5002 (source);
}
static void opto_i2c_init(void)
{
int i, curr_value;
/*
* 0x7000c00C -> 0x7000C140 are the I2C controller
*/
/* wait for value to settle */
i = 1000;
curr_value = (inl(0x7000c104) << 16) >> 24;
while (i > 0) {
int new_value = (inl(0x7000c104) << 16) >> 24;
if (new_value != curr_value) {
i = 10000;
curr_value = new_value;
} else {
i--;
}
}
outb(inb(IPOD_PP5020_GPIOB_OUTPUT_VAL) | 0x10, IPOD_PP5020_GPIOB_OUTPUT_VAL); /* port B bit 4 = 1 */
outl(inl(IPOD_PP5020_DEV_EN) | 0x10000, IPOD_PP5020_DEV_EN); /* dev enable */
outl(inl(IPOD_PP5020_DEV_RS) | 0x10000, IPOD_PP5020_DEV_RS); /* dev reset */
mlc_delay_us(5);
outl(inl(IPOD_PP5020_DEV_RS) & ~0x10000, IPOD_PP5020_DEV_RS); /* dev reset finish */
outl(0xffffffff, 0x7000c120);
outl(0xffffffff, 0x7000c124);
outl(0xc00a1f00, 0x7000c100);
outl(0x1000000, 0x7000c104);
}
static int button_mask = 0;
static void hdl_i2c_key (unsigned statusok, unsigned *new_button_mask, unsigned mask, uint8 key)
{
if (statusok) {
*new_button_mask |= mask;
if (!(button_mask & mask)) {
handle_scancode (key, 1);
}
} else if (button_mask & mask) {
handle_scancode (key, 0);
}
}
static int i2c_intr_count = 0;
static int i2c_last_status = 0;
static int i2c_reset_status = 0;
static int i2c_reset_count = 0;
static void key_i2c_interrupt(int irq, void *dev_id, struct pt_regs * regs)
{
unsigned reg, status;
static int wheelloc = -1;
static int lasttouch = 0;
if (lasttouch && ((inl(IPOD_PP5020_USEC_TIMER) - lasttouch) > 500000)) {
lasttouch = 0;
wheelloc = -1;
}
mlc_delay_us(250);
i2c_intr_count++;
reg = 0x7000c104;
if ((inl(0x7000c104) & 0x4000000) != 0) {
reg = reg + 0x3C; /* 0x7000c140 */
status = inl(0x7000c140);
outl(0x0, 0x7000c140); /* clear interrupt status? */
i2c_last_status = status;
uint16 touch = (status >> 16) & 0x7f;
if ((status & 0x800000ff) == 0x8000001a) {
unsigned int new_button_mask = 0;
hdl_i2c_key (status & 0x0100, &new_button_mask, 0x01, ACTION_SC);
hdl_i2c_key (status & 0x1000, &new_button_mask, 0x10, UP_SC);
hdl_i2c_key (status & 0x0800, &new_button_mask, 0x08, DOWN_SC);
hdl_i2c_key (status & 0x0200, &new_button_mask, 0x02, RIGHT_SC);
hdl_i2c_key (status & 0x0400, &new_button_mask, 0x04, LEFT_SC);
if ((status & 0x40000000) != 0) {
// scroll wheel down
int adjtouch = touch;
if (touch > wheelloc) {
if ((touch - wheelloc) > ((96 + wheelloc - touch)))
adjtouch -= 96;
} else {
if ((wheelloc - touch) > ((96 + touch - wheelloc)))
adjtouch += 96;
}
if (wheelloc == -1) {
wheelloc = touch;
lasttouch = inl(IPOD_PP5020_USEC_TIMER);
} else if ((adjtouch - wheelloc) > 12) {
wheelloc = touch;
lasttouch = inl(IPOD_PP5020_USEC_TIMER);
handle_scancode(R_SC, 1);
handle_scancode(R_SC, 0);
} else if ((adjtouch - wheelloc) < -12) {
wheelloc = touch;
lasttouch = inl(IPOD_PP5020_USEC_TIMER);
handle_scancode(L_SC, 1);
handle_scancode(L_SC, 0);
} else if (wheelloc != touch) {
lasttouch = inl(IPOD_PP5020_USEC_TIMER);
}
} else if (button_mask & 0x20) {
// scroll wheel up
wheelloc = -1;
}
button_mask = new_button_mask;
} else if ((status & 0x800000FF) == 0x8000003A) {
wheelloc = touch;
} else {
int v = (unsigned)status >> 4;
if ((v == 0xfffffff) || (v == 0x5555555) || (v == 0xaaaaaaa)) {
// this happens after a Hold switch release (status is then fffffffx, aaaaaaax, 5555555x)
i2c_reset_status = status;
i2c_reset_count++;
opto_i2c_init();
}
}
}
if ((inl(reg) & 0x8000000) != 0) {
outl(0xffffffff, 0x7000c120);
outl(0xffffffff, 0x7000c124);
}
outl(inl(0x7000c104) | 0xC000000, 0x7000c104);
outl(0x400a1f00, 0x7000c100);
outb(inb(IPOD_PP5020_GPIOB_OUTPUT_VAL) | 0x10, IPOD_PP5020_GPIOB_OUTPUT_VAL); /* port B bit 4 = 1 */
}
static void process_keys_502x (uint8 source, uint8 wheel_source, uint8 wheel_state)
{
uint8 state;
/* get current keypad & wheel status */
state = inb(IPOD_PP5020_GPIOA_INPUT_VAL) & 0x3f;
if (source) {
last_source = source;
last_state = state;
}
outb(~state, IPOD_PP5020_GPIOA_INT_LEV); // toggle interrupt level
if (ipod_hw_ver == 0x4) {
wheel_state = inb(IPOD_PP5020_GPIOB_INPUT_VAL) & 0x30;
outb(~wheel_state, IPOD_PP5020_GPIOB_INT_LEV); // toggle interrupt level
}
if (source & IPOD_KEYPAD_HOLD) {
// hold switch is active low
int engaged = !(state & IPOD_KEYPAD_HOLD);
handle_scancode (HOLD_SC, engaged);
if (!engaged) {
handle_scroll_wheel (-1, 0); // reset
} else {
state = 0x1f; // clear all keys
}
}
if (ipod_hw_ver == 0x4) {
check_key (source, state, 0x01, ACTION_SC);
check_key (source, state, 0x02, UP_SC);
check_key (source, state, 0x04, DOWN_SC);
check_key (source, state, 0x08, RIGHT_SC);
check_key (source, state, 0x10, LEFT_SC);
if (wheel_source & 0x30) {
handle_scroll_wheel ((wheel_state >> 4) & 3, 1);
}
}
}
static void key_mini_interrupt(int irq, void *dev_id, struct pt_regs * regs)
{
uint8 source, wheel_source, wheel_state = 0;
/* we need some delay for mini, cause hold generates several interrupts,
* some of them delayed
*/
mlc_delay_us(250);
/* get source(s) of interupt */
source = inb(IPOD_PP5020_GPIOA_INT_STAT) & 0x3f;
if (ipod_hw_ver == 0x4) {
wheel_source = inb(IPOD_PP5020_GPIOB_INT_STAT) & 0x30;
} else {
wheel_source = 0x0;
}
if (source == 0 && wheel_source == 0) {
return; // not for us
}
process_keys_502x (source, wheel_source, wheel_state);
/* ack any active interrupts */
if (source) {
outb(source, IPOD_PP5020_GPIOA_INT_CLR);
}
if (wheel_source) {
outb(wheel_source, IPOD_PP5020_GPIOB_INT_CLR);
}
}
void keypad_test (void)
// used to debug the hold switch behaviour
{
console_setcolor(WHITE, BLACK, 0);
do {
int src, stt;
console_clear();
console_suppress_fbupdate (1); // suppresses fb_update calls for now
mlc_printf ("Keypad test screen\n");
if( ipod_hw_ver < 4 ) {
src = inb(IPOD_PP5002_GPIOA_INT_STAT);
stt = inb(IPOD_PP5002_GPIOA_INPUT_VAL);
} else {
src = inb(IPOD_PP5020_GPIOA_INT_STAT);
stt = inb(IPOD_PP5020_GPIOA_INPUT_VAL);
}
mlc_printf (" source %02x (%02x)\n", src, last_source);
mlc_printf (" state1 %02x (%02x)\n", stt, last_state);
if( ipod_hw_ver >= 4 ) {
mlc_printf (" i2c cnt %d\n", i2c_intr_count);
mlc_printf (" %08x (%08x)\n", (int)inl(0x7000c140), i2c_last_status);
mlc_printf (" rst %d (%08x)\n", i2c_reset_count, i2c_reset_status);
}
mlc_printf (" kbd_state %02x\n", kbd_state);
mlc_printf ("press << and >> to exit\n");
console_suppress_fbupdate (-1); // calls fb_update now
} while (kbd_state != (IPOD_KEYPAD_PREV+IPOD_KEYPAD_NEXT));
console_clear();
mlc_printf ("release all buttons\n");
while (kbd_state & 0x1f) {
mlc_delay_ms(10);
} // wait for buttons being released again
kbdbufelems = 0;
console_printcount = 0;
}
static void kbd_poll ()
{
if (ipod_hw_ver < 4) {
kbd_intr_5002 (0, 0, 0);
} else {
key_mini_interrupt (0, 0, 0);
if (ipod_hw_ver > 4) {
key_i2c_interrupt (0, 0, 0);
}
}
}
void keypad_enable_wheelclicks (int rew_left, int fwd_left)
{
do_clicks_rew = rew_left;
do_clicks_fwd = fwd_left;
}
/*
* Keypad initialization.
* Sets up the clickwheel.
*/
void keypad_init(void)
{
int err;
ipod_hw_ver = ipod_get_hwinfo()->hw_ver;
if( ipod_hw_ver < 4 ) {
/*
* iPod 1G, 2G, 3G.
*
* These use the PP5002 memory mapping.
*/
outb(~inb(IPOD_PP5002_GPIOA_INPUT_VAL), IPOD_PP5002_GPIOA_INT_LEV);
outb(inb(IPOD_PP5002_GPIOA_INT_STAT), IPOD_PP5002_GPIOA_INT_CLR);
if (ipod_hw_ver == 0x1) {
outb(inb(IPOD_PP5002_GPIOB_ENABLE) | 0x1, IPOD_PP5002_GPIOB_ENABLE);
outb(inb(IPOD_PP5002_GPIOB_OUTPUT_EN) | 0x1, IPOD_PP5002_GPIOB_OUTPUT_EN);
outb(inb(IPOD_PP5002_GPIOB_OUTPUT_VAL) | 0x1, IPOD_PP5002_GPIOB_OUTPUT_VAL);
}
if ((err = request_irq (PP5002_GPIO_IRQ, kbd_intr_5002, 1, KEYBOARD_DEV_ID)) != 0) {
mlc_printf("ipodkb: IRQ %d failed: %d\n", PP5002_GPIO_IRQ, err);
mlc_show_critical_error();
}
process_keys_5002 (0x3f); // get the current state of keys and hold switch
// enable interrupts
outb(0xff, IPOD_PP5002_GPIOA_INT_EN);
}
else if( ipod_hw_ver == 4 ) {
/*
* iPod Mini 1G.
*
* This uses the PP5020 memory mapping, but communicates with the clickwheel
* via GPIO A.
*/
/* buttons - enable as input */
outb(inb(IPOD_PP5020_GPIOA_ENABLE) | 0x3f, IPOD_PP5020_GPIOA_ENABLE);
outb(inb(IPOD_PP5020_GPIOA_OUTPUT_EN) & ~0x3f, IPOD_PP5020_GPIOA_OUTPUT_EN);
/* scroll wheel- enable as input */
outb(inb(IPOD_PP5020_GPIOB_ENABLE) | 0x30, IPOD_PP5020_GPIOB_ENABLE); /* port b 4,5 */
outb(inb(IPOD_PP5020_GPIOB_OUTPUT_EN) & ~0x30, IPOD_PP5020_GPIOB_OUTPUT_EN); /* port b 4,5 */
/* buttons - set interrupt levels */
outb(~(inb(IPOD_PP5020_GPIOA_INPUT_VAL) & 0x3f), IPOD_PP5020_GPIOA_INT_LEV);
outb((inb(IPOD_PP5020_GPIOA_INT_STAT) & 0x3f), IPOD_PP5020_GPIOA_INT_CLR);
/* scroll wheel - set interrupt levels */
outb(~(inb(IPOD_PP5020_GPIOB_INPUT_VAL) & 0x30), IPOD_PP5020_GPIOB_INT_LEV);
outb((inb(IPOD_PP5020_GPIOB_INT_STAT) & 0x30), IPOD_PP5020_GPIOB_INT_CLR);
if ((err = request_irq (PP5020_GPIO_IRQ, key_mini_interrupt, 1, KEYBOARD_DEV_ID)) != 0) {
mlc_printf("ipodkb: IRQ %d failed: %d\n", PP5020_GPIO_IRQ, err);
mlc_show_critical_error();
}
process_keys_502x (0x3f, 0, 0); // get the current state of keys and hold switch
// enable interrupts
outb(0x3f, IPOD_PP5020_GPIOA_INT_EN);
outb(0x30, IPOD_PP5020_GPIOB_INT_EN);
}
else {
/*
* iPod 4G, Photo (4G with color display), Mini 2G, 5G, Nano, etc.
*
* These use the PP5020 memory mapping, and communicate with the clickwheel
* over i2c.
*/
/* this call seems not be needed, and we learned that it causes problems on some models,
so we happily skip this call:
ipod_i2c_init();
*/
opto_i2c_init();
if ((err = request_irq (PP5020_GPIO_IRQ, key_mini_interrupt, 1, KEYBOARD_DEV_ID)) != 0) {
mlc_printf("ipodkb: IRQ %d failed: %d\n", PP5020_GPIO_IRQ, err);
mlc_show_critical_error();
}
if ((err = request_irq (PP5020_I2C_IRQ, key_i2c_interrupt, 1, KEYBOARD_DEV_ID)) != 0) {
mlc_printf("ipodkb: IRQ %d (i2c) failed: %d\n", PP5020_GPIO_IRQ, err);
mlc_show_critical_error();
}
process_keys_502x (0x3f, 0, 0); // get the current state of keys and hold switch
// hold switch - enable as input
outb(inb(IPOD_PP5020_GPIOA_ENABLE) | 0x20, IPOD_PP5020_GPIOA_ENABLE);
outb(inb(IPOD_PP5020_GPIOA_OUTPUT_EN) & ~0x20, IPOD_PP5020_GPIOA_OUTPUT_EN);
// hold switch - set interrupt levels
outb(~(inb(IPOD_PP5020_GPIOA_INPUT_VAL) & 0x20), IPOD_PP5020_GPIOA_INT_LEV);
outb((inb(IPOD_PP5020_GPIOA_INT_STAT) & 0x20), IPOD_PP5020_GPIOA_INT_CLR);
// enable interrupts
outb(0x20, IPOD_PP5020_GPIOA_INT_EN);
}
}
void keypad_exit(void)
{
// disable interrupts
if( ipod_hw_ver < 4 ) {
outb(0x00, IPOD_PP5002_GPIOA_INT_EN);
} else {
outb(0x00, IPOD_PP5020_GPIOA_INT_EN);
outb(0x00, IPOD_PP5020_GPIOB_INT_EN);
}
}