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("Available commands:");
puts("help - Show this command"); puts("help - Show this command");
puts("reboot - Reboot CPU"); puts("reboot - Reboot CPU");
#ifdef CSR_LEDS_BASE
puts("led - Led demo");
#endif
puts("donut - Spinning Donut demo"); puts("donut - Spinning Donut demo");
#ifdef CSR_LEDS_BASE #ifdef CSR_LEDS_BASE
puts("led - Led demo");
puts("leds - Led set demo"); puts("leds - Led set demo");
#endif #endif
#ifdef CSR_AUDIO_BASE #ifdef CSR_AUDIO_BASE
@ -117,9 +115,7 @@ void led(void);
static void led_cmd(void) { static void led_cmd(void) {
led(); led();
} }
#endif
#ifdef CSR_LEDS_BASE
static void leds_cmd(char **val) { static void leds_cmd(char **val) {
int value = (int)strtol(get_token(val), NULL, 0); int value = (int)strtol(get_token(val), NULL, 0);
printf("Setting LED to %6x\n", value); printf("Setting LED to %6x\n", value);
@ -250,13 +246,11 @@ static void console_service(void) {
help(); help();
else if (strcmp(token, "reboot") == 0) else if (strcmp(token, "reboot") == 0)
reboot_cmd(); reboot_cmd();
#ifdef CSR_LEDS_BASE
else if (strcmp(token, "led") == 0)
led_cmd();
#endif
else if (strcmp(token, "donut") == 0) else if (strcmp(token, "donut") == 0)
donut_cmd(); donut_cmd();
#ifdef CSR_LEDS_BASE #ifdef CSR_LEDS_BASE
else if (strcmp(token, "led") == 0)
led_cmd();
else if (strcmp(token, "leds") == 0) else if (strcmp(token, "leds") == 0)
leds_cmd(&str); leds_cmd(&str);
#endif #endif

15
make.py
View file

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