software/demo: make leds optional.

Allow running demo directly with litex_sim:
litex_sim (then exit with ctrl-c on BIOS prompt)
litex_bare_metal_demo --build-path=build/sim/
litex_sim --ram-init=demo.bin
This commit is contained in:
Florent Kermarrec 2020-12-30 11:20:55 +01:00
parent 052a76f253
commit 4f6bc32a5a
1 changed files with 6 additions and 0 deletions

View File

@ -83,7 +83,9 @@ static void help(void)
puts("Available commands:");
puts("help - Show this command");
puts("reboot - Reboot CPU");
#ifdef CSR_LEDS_BASE
puts("led - Led demo");
#endif
puts("donut - Spinning Donut demo");
}
@ -96,6 +98,7 @@ static void reboot_cmd(void)
ctrl_reset_write(1);
}
#ifdef CSR_LEDS_BASE
static void led_cmd(void)
{
int i;
@ -125,6 +128,7 @@ static void led_cmd(void)
busy_wait(200);
}
}
#endif
extern void donut(void);
@ -150,8 +154,10 @@ static void console_service(void)
help();
else if(strcmp(token, "reboot") == 0)
reboot_cmd();
#ifdef CSR_LEDS_BASE
else if(strcmp(token, "led") == 0)
led_cmd();
#endif
else if(strcmp(token, "donut") == 0)
donut_cmd();
prompt();