FreeBSD/sys/dev/gpio/gpiokeys.c
/* read one byte from the keyboard if it's allowed */
read one byte from the keyboard if it's allowed
read one byte from the keyboard if it ' s allowed
static int
gpiokeys_read(keyboard_t *kbd, int wait)
{
	struct gpiokeys_softc *sc = kbd->kb_data;
	int32_t keycode;
	if (!KBD_IS_ACTIVE(kbd))
		return (-1);
	keycode = gpiokeys_get_key(sc, (wait == FALSE) ? 0 : 1);
	if (!KBD_IS_ACTIVE(kbd) || (keycode == -1))
		return (-1);
	++(kbd->kb_count);
	return (keycode);
}
static int gpiokeys_read ( keyboard_t * kbd , int wait ) { struct gpiokeys_softc * sc = kbd -> kb_data ; int32_t keycode ; if ( ! KBD_IS_ACTIVE ( kbd ) ) return ( -1 ) ; keycode = gpiokeys_get_key ( sc , ( wait == FALSE ) ? 0 : 1 ) ; if ( ! KBD_IS_ACTIVE ( kbd ) || ( keycode == -1 ) ) return ( -1 ) ; ++ ( kbd -> kb_count ) ; return ( keycode ) ; }
read one byte from the keyboard if it's allowed
read one byte from the keyboard if it ' s allowed
/* XXX */