Rename ledchaser module to line up with ifdefs

This commit is contained in:
Aadi Desai 2023-05-24 12:42:34 +01:00
parent 48b8e17ff2
commit 2f40fb3bb5
No known key found for this signature in database
2 changed files with 11 additions and 16 deletions

View file

@ -83,11 +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");
#ifdef CSR_LEDS_BASE
puts("led - Led demo");
puts("leds - Led set demo");
#endif
#ifdef CSR_AUDIO_BASE
@ -117,9 +115,7 @@ void led(void);
static void led_cmd(void) {
led();
}
#endif
#ifdef CSR_LEDS_BASE
static void leds_cmd(char **val) {
int value = (int)strtol(get_token(val), NULL, 0);
printf("Setting LED to %6x\n", value);
@ -250,13 +246,11 @@ 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();
#ifdef CSR_LEDS_BASE
else if (strcmp(token, "led") == 0)
led_cmd();
else if (strcmp(token, "leds") == 0)
leds_cmd(&str);
#endif

15
make.py
View file

@ -198,17 +198,18 @@ class BaseSoC(SoCCore):
# Leds -------------------------------------------------------------------------------------
if with_led_chaser:
# self.leds = LedChaser(
# pads = platform.request_all("user_led"),
# sys_clk_freq = sys_clk_freq)
self.ledchaser = LedChaser(
pads = platform.request_all("user_led"),
sys_clk_freq = sys_clk_freq
)
# self.leds = TestLed(
# platform = platform,
# pads = platform.request_all("user_led")
# )
self.leds = TestRgb(
platform = platform,
pads = platform.request_all("user_led")
)
# self.leds = TestRgb(
# platform = platform,
# pads = platform.request_all("user_led")
# )
# GPIO Pins --------------------------------------------------------------------------------
platform.add_extension([