/* generate a null-terminated string containing the buttons pressed returns number of keys pressed  */
static int read_keys(char *buf)
/* generate a null-terminated string containing the buttons pressed returns number of keys pressed  */
static int read_keys(char *buf)
{
	int i, numpressed = 0;
	for (i = 0; i < ARRAY_SIZE(buttons); i++) {
		if (!gpio_get_value(buttons[i].gpnum))
			buf[numpressed++] = buttons[i].ident;
	}
	buf[numpressed] = '\0';
	return numpressed;
}