bios/cmd_bios: Add buttons command to get buttons value.

This commit is contained in:
Florent Kermarrec 2022-08-04 16:31:12 +02:00
parent 8250f56f80
commit 47df2f6983
1 changed files with 16 additions and 0 deletions

View File

@ -139,6 +139,22 @@ define_command(flush_cpu_dcache, flush_cpu_dcache, "Flush CPU data cache", SYSTE
define_command(flush_l2_cache, flush_l2_cache, "Flush L2 cache", SYSTEM_CMDS);
#endif
/**
* Command "buttons"
*
* Set Buttons value
*
*/
#ifdef CSR_BUTTONS_BASE
static void buttons_handler(int nb_params, char **params)
{
unsigned int value;
value = buttons_in_read();
printf("Buttons value: 0x%x", value);
}
define_command(buttons, buttons_handler, "Get Buttons value", SYSTEM_CMDS);
#endif
/**
* Command "leds"
*