From 05db4276d42471d78f2a00a90c8567e3c1c2e002 Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Wed, 4 Dec 2024 01:28:33 -0700 Subject: Proper timing for leds using systick and interrupts. This means a new "frame" is written every 30th of a second. --- include/sysled.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/sysled.h b/include/sysled.h index b9556f1..b1a21c1 100644 --- a/include/sysled.h +++ b/include/sysled.h @@ -6,14 +6,12 @@ static inline void enable_sysled() { - CH573_GPIO__GPIO_PORT_T_INTF.dir.set(ch573_gpio__gpio_port_a, DIR_OUT, 8); - CH573_GPIO__GPIO_PORT_T_INTF.pd_drv.set(ch573_gpio__gpio_port_a, 0, 8); + CH573_GPIO__GPIO_PORT_T_INTF.dir.set(ch573_gpio__gpio_port_b, DIR_OUT, 10); + CH573_GPIO__GPIO_PORT_T_INTF.pd_drv.set(ch573_gpio__gpio_port_b, 1, 10); } -// If "on" then turn on the sysled (which counter-intuitively means turning off -// the GPIO). static inline void set_sysled(int on) { -// CH573_GPIO__GPIO_PORT_T_INTF.out.set( -// ch573_gpio__gpio_port_a, on ? OFF : ON, 8); + CH573_GPIO__GPIO_PORT_T_INTF.out.set( + ch573_gpio__gpio_port_b, on ? ON : OFF, 10); } -- cgit