staticint udbg_adb_local_getc(void)
{ int k, t, on;
xmon_wants_key = 1; for (;;) {
xmon_adb_keycode = -1;
t = 0;
on = 0;
k = -1; do { if (--t < 0) {
on = 1 - on;
btext_drawchar(on? 0xdb: 0x20);
btext_drawchar('\b');
t = 200000;
}
udbg_adb_poll(); if (udbg_adb_old_getc_poll)
k = udbg_adb_old_getc_poll();
} while (k == -1 && xmon_adb_keycode == -1); if (on)
btext_drawstring(" \b"); if (k != -1) return k;
k = xmon_adb_keycode;
/* test for shift keys */ if ((k & 0x7f) == 0x38 || (k & 0x7f) == 0x7b) {
xmon_adb_shiftstate = (k & 0x80) == 0; continue;
} if (k >= 0x80) continue; /* ignore up transitions */
k = (xmon_adb_shiftstate? xmon_shift_keytab: xmon_keytab)[k]; if (k != 0) break;
}
xmon_wants_key = 0; return k;
} #endif/* CONFIG_BOOTX_TEXT */
/* getc_poll() is not really used, unless you have the xmon-over modem * hack that doesn't quite concern us here, thus we just poll the low level * ADB driver to prevent it from timing out and call back the original poll * routine.
*/ staticint udbg_adb_getc_poll(void)
{
udbg_adb_poll();
if (udbg_adb_old_getc_poll) return udbg_adb_old_getc_poll(); return -1;
}
staticvoid udbg_adb_putc(char c)
{ #ifdef CONFIG_BOOTX_TEXT if (udbg_adb_use_btext)
btext_drawchar(c); #endif if (udbg_adb_old_putc) return udbg_adb_old_putc(c);
}
/* Check if our early init was already called */ if (udbg_adb_old_putc == udbg_adb_putc)
udbg_adb_old_putc = NULL; #ifdef CONFIG_BOOTX_TEXT if (udbg_adb_old_putc == btext_drawchar)
udbg_adb_old_putc = NULL; #endif
/* Set ours as output */
udbg_putc = udbg_adb_putc;
udbg_getc = udbg_adb_getc;
udbg_getc_poll = udbg_adb_getc_poll;
#ifdef CONFIG_BOOTX_TEXT /* Check if we should use btext output */ if (btext_find_display(force_btext) == 0)
udbg_adb_use_btext = 1; #endif
/* See if there is a keyboard in the device tree with a parent * of type "adb". If not, we return a failure, but we keep the * bext output set for now
*/
for_each_node_by_name(np, "keyboard") { struct device_node *parent = of_get_parent(np); int found = of_node_is_type(parent, "adb");
of_node_put(parent); if (found) break;
} if (np == NULL) return -ENODEV;
of_node_put(np);
#ifdef CONFIG_ADB_PMU if (find_via_pmu())
input_type = input_adb_pmu; #endif #ifdef CONFIG_ADB_CUDA if (find_via_cuda())
input_type = input_adb_cuda; #endif
/* Same as above: nothing found, keep btext set for output */ if (input_type == input_adb_none) return -ENODEV;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.