summaryrefslogtreecommitdiff
path: root/hid/pico
diff options
context:
space:
mode:
authorMaxim Devaev <[email protected]>2023-08-14 14:42:54 +0300
committerMaxim Devaev <[email protected]>2023-08-14 14:42:54 +0300
commitf9ab76b247cdc85765a321116c1afd918920c6b0 (patch)
treea09dddd86e59617c65abf3d508662aee1ada2e99 /hid/pico
parent69163ccfb155f318be6c3a715dbc7efe57e535e3 (diff)
pico hid refactoring
Diffstat (limited to 'hid/pico')
-rw-r--r--hid/pico/src/ph_cmds.h2
-rw-r--r--hid/pico/src/ph_debug.h2
-rw-r--r--hid/pico/src/ph_ps2.c6
-rw-r--r--hid/pico/src/ph_usb_keymap.h2
-rw-r--r--hid/pico/src/ph_usb_keymap.h.mako2
5 files changed, 9 insertions, 5 deletions
diff --git a/hid/pico/src/ph_cmds.h b/hid/pico/src/ph_cmds.h
index 549b65e3..bfb820c5 100644
--- a/hid/pico/src/ph_cmds.h
+++ b/hid/pico/src/ph_cmds.h
@@ -20,6 +20,8 @@
# ========================================================================= */
+#pragma once
+
#include "ph_types.h"
diff --git a/hid/pico/src/ph_debug.h b/hid/pico/src/ph_debug.h
index 32dcd691..db7ef31d 100644
--- a/hid/pico/src/ph_debug.h
+++ b/hid/pico/src/ph_debug.h
@@ -20,6 +20,8 @@
*****************************************************************************/
+#pragma once
+
#include "ph_types.h"
diff --git a/hid/pico/src/ph_ps2.c b/hid/pico/src/ph_ps2.c
index 03fbe9b7..60723a1c 100644
--- a/hid/pico/src/ph_ps2.c
+++ b/hid/pico/src/ph_ps2.c
@@ -26,9 +26,9 @@
#include "ph_outputs.h"
-u8 ph_g_ps2_kbd_leds;
-bool ph_g_ps2_kbd_online;
-bool ph_g_ps2_mouse_online;
+u8 ph_g_ps2_kbd_leds = 0;
+bool ph_g_ps2_kbd_online = 0;
+bool ph_g_ps2_mouse_online = 0;
void ph_ps2_init(void) {
diff --git a/hid/pico/src/ph_usb_keymap.h b/hid/pico/src/ph_usb_keymap.h
index e33bbd08..951949ae 100644
--- a/hid/pico/src/ph_usb_keymap.h
+++ b/hid/pico/src/ph_usb_keymap.h
@@ -25,7 +25,7 @@
#include "ph_types.h"
-u8 ph_usb_keymap(u8 key) {
+inline u8 ph_usb_keymap(u8 key) {
switch (key) {
case 1: return 4; // KeyA
case 2: return 5; // KeyB
diff --git a/hid/pico/src/ph_usb_keymap.h.mako b/hid/pico/src/ph_usb_keymap.h.mako
index b90e8970..dd156fed 100644
--- a/hid/pico/src/ph_usb_keymap.h.mako
+++ b/hid/pico/src/ph_usb_keymap.h.mako
@@ -25,7 +25,7 @@
#include "ph_types.h"
<%! import operator %>
-u8 ph_usb_keymap(u8 key) {
+inline u8 ph_usb_keymap(u8 key) {
switch (key) {
% for km in sorted(keymap, key=operator.attrgetter("mcu_code")):
% if km.usb_key.is_modifier: