summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Devaev <[email protected]>2023-08-04 04:19:50 +0300
committerMaxim Devaev <[email protected]>2023-08-04 04:19:50 +0300
commitb44c8516d7efec87a6ea5d96b175fedaf5252b7f (patch)
tree59b9cf557d07415e1c413f3b9f3fb38d06a43f33
parent8c6e9eb4c112a4a63f5262daae1a9d24757cc6f2 (diff)
pico hid: slow blinking
-rw-r--r--hid/pico/src/main.c2
-rw-r--r--hid/pico/src/ph_debug.c6
-rw-r--r--hid/pico/src/ph_debug.h1
3 files changed, 7 insertions, 2 deletions
diff --git a/hid/pico/src/main.c b/hid/pico/src/main.c
index 69508689..26c7c922 100644
--- a/hid/pico/src/main.c
+++ b/hid/pico/src/main.c
@@ -115,7 +115,7 @@ int main(void) {
ph_usb_task();
if (!_reset_required) {
ph_spi_task();
- ph_debug_act_pulse(50);
+ ph_debug_act_pulse(100);
}
}
return 0;
diff --git a/hid/pico/src/ph_debug.c b/hid/pico/src/ph_debug.c
index 5063c0d8..79eb64a3 100644
--- a/hid/pico/src/ph_debug.c
+++ b/hid/pico/src/ph_debug.c
@@ -41,12 +41,16 @@ void ph_debug_init(bool enable_uart) {
gpio_set_dir(_ACT_PIN, GPIO_OUT);
}
+void ph_debug_act(bool flag) {
+ gpio_put(_ACT_PIN, flag);
+}
+
void ph_debug_act_pulse(u64 delay_ms) {
static bool flag = false;
static u64 next_ts = 0;
const u64 now_ts = time_us_64();
if (now_ts >= next_ts) {
- gpio_put(_ACT_PIN, flag);
+ ph_debug_act(flag);
flag = !flag;
next_ts = now_ts + (delay_ms * 1000);
}
diff --git a/hid/pico/src/ph_debug.h b/hid/pico/src/ph_debug.h
index ef8afdda..4dd92ce3 100644
--- a/hid/pico/src/ph_debug.h
+++ b/hid/pico/src/ph_debug.h
@@ -24,4 +24,5 @@
void ph_debug_init(bool enable_uart);
+void ph_debug_act(bool flag);
void ph_debug_act_pulse(u64 delay_ms);