From 4f6bc32a5a430c4b7054e1dffbba9f3b29216e7d Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Wed, 30 Dec 2020 11:20:55 +0100 Subject: [PATCH] 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 --- litex/soc/software/demo/main.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/litex/soc/software/demo/main.c b/litex/soc/software/demo/main.c index 89f369cc5..aaca31174 100644 --- a/litex/soc/software/demo/main.c +++ b/litex/soc/software/demo/main.c @@ -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();