From 842aa5a842e117b7b00e49258ca0bde44dc0c789 Mon Sep 17 00:00:00 2001 From: innovaker <66737976+innovaker@users.noreply.github.com> Date: Tue, 22 Dec 2020 15:56:00 +0000 Subject: refactor: replace filename hyphens with underscores Aligns *.h and *.c to underscore naming convention. These were kept (with warnings) for backwards compatibility with external boards/shields: - kscan-mock.h - matrix-transform.h They should be removed in the future. PR: #523 --- app/include/zmk/events/activity-state-changed.h | 26 ------------- app/include/zmk/events/activity_state_changed.h | 26 +++++++++++++ app/include/zmk/events/battery-state-changed.h | 18 --------- app/include/zmk/events/battery_state_changed.h | 18 +++++++++ .../zmk/events/ble-active-profile-changed.h | 21 ----------- .../zmk/events/ble_active_profile_changed.h | 21 +++++++++++ app/include/zmk/events/keycode-state-changed.h | 43 ---------------------- app/include/zmk/events/keycode_state_changed.h | 43 ++++++++++++++++++++++ app/include/zmk/events/layer-state-changed.h | 28 -------------- app/include/zmk/events/layer_state_changed.h | 28 ++++++++++++++ app/include/zmk/events/modifiers-state-changed.h | 28 -------------- app/include/zmk/events/modifiers_state_changed.h | 28 ++++++++++++++ app/include/zmk/events/position-state-changed.h | 19 ---------- app/include/zmk/events/position_state_changed.h | 19 ++++++++++ app/include/zmk/events/sensor-event.h | 20 ---------- app/include/zmk/events/sensor_event.h | 20 ++++++++++ app/include/zmk/events/usb-conn-state-changed.h | 20 ---------- app/include/zmk/events/usb_conn_state_changed.h | 20 ++++++++++ 18 files changed, 223 insertions(+), 223 deletions(-) delete mode 100644 app/include/zmk/events/activity-state-changed.h create mode 100644 app/include/zmk/events/activity_state_changed.h delete mode 100644 app/include/zmk/events/battery-state-changed.h create mode 100644 app/include/zmk/events/battery_state_changed.h delete mode 100644 app/include/zmk/events/ble-active-profile-changed.h create mode 100644 app/include/zmk/events/ble_active_profile_changed.h delete mode 100644 app/include/zmk/events/keycode-state-changed.h create mode 100644 app/include/zmk/events/keycode_state_changed.h delete mode 100644 app/include/zmk/events/layer-state-changed.h create mode 100644 app/include/zmk/events/layer_state_changed.h delete mode 100644 app/include/zmk/events/modifiers-state-changed.h create mode 100644 app/include/zmk/events/modifiers_state_changed.h delete mode 100644 app/include/zmk/events/position-state-changed.h create mode 100644 app/include/zmk/events/position_state_changed.h delete mode 100644 app/include/zmk/events/sensor-event.h create mode 100644 app/include/zmk/events/sensor_event.h delete mode 100644 app/include/zmk/events/usb-conn-state-changed.h create mode 100644 app/include/zmk/events/usb_conn_state_changed.h (limited to 'app/include/zmk/events') diff --git a/app/include/zmk/events/activity-state-changed.h b/app/include/zmk/events/activity-state-changed.h deleted file mode 100644 index cd4c618..0000000 --- a/app/include/zmk/events/activity-state-changed.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2020 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ - -#pragma once - -#include -#include -#include - -struct activity_state_changed { - struct zmk_event_header header; - enum zmk_activity_state state; -}; - -ZMK_EVENT_DECLARE(activity_state_changed); - -static inline struct activity_state_changed * -create_activity_state_changed(enum zmk_activity_state state) { - struct activity_state_changed *ev = new_activity_state_changed(); - ev->state = state; - - return ev; -} \ No newline at end of file diff --git a/app/include/zmk/events/activity_state_changed.h b/app/include/zmk/events/activity_state_changed.h new file mode 100644 index 0000000..511fbad --- /dev/null +++ b/app/include/zmk/events/activity_state_changed.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2020 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#pragma once + +#include +#include +#include + +struct activity_state_changed { + struct zmk_event_header header; + enum zmk_activity_state state; +}; + +ZMK_EVENT_DECLARE(activity_state_changed); + +static inline struct activity_state_changed * +create_activity_state_changed(enum zmk_activity_state state) { + struct activity_state_changed *ev = new_activity_state_changed(); + ev->state = state; + + return ev; +} \ No newline at end of file diff --git a/app/include/zmk/events/battery-state-changed.h b/app/include/zmk/events/battery-state-changed.h deleted file mode 100644 index a983820..0000000 --- a/app/include/zmk/events/battery-state-changed.h +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2020 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ - -#pragma once - -#include -#include - -struct battery_state_changed { - struct zmk_event_header header; - // TODO: Other battery channels - uint8_t state_of_charge; -}; - -ZMK_EVENT_DECLARE(battery_state_changed); \ No newline at end of file diff --git a/app/include/zmk/events/battery_state_changed.h b/app/include/zmk/events/battery_state_changed.h new file mode 100644 index 0000000..47e44ba --- /dev/null +++ b/app/include/zmk/events/battery_state_changed.h @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2020 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#pragma once + +#include +#include + +struct battery_state_changed { + struct zmk_event_header header; + // TODO: Other battery channels + uint8_t state_of_charge; +}; + +ZMK_EVENT_DECLARE(battery_state_changed); \ No newline at end of file diff --git a/app/include/zmk/events/ble-active-profile-changed.h b/app/include/zmk/events/ble-active-profile-changed.h deleted file mode 100644 index 4491dfc..0000000 --- a/app/include/zmk/events/ble-active-profile-changed.h +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2020 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ - -#pragma once - -#include -#include -#include - -#include - -struct ble_active_profile_changed { - struct zmk_event_header header; - uint8_t index; - struct zmk_ble_profile *profile; -}; - -ZMK_EVENT_DECLARE(ble_active_profile_changed); diff --git a/app/include/zmk/events/ble_active_profile_changed.h b/app/include/zmk/events/ble_active_profile_changed.h new file mode 100644 index 0000000..fa16126 --- /dev/null +++ b/app/include/zmk/events/ble_active_profile_changed.h @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#pragma once + +#include +#include +#include + +#include + +struct ble_active_profile_changed { + struct zmk_event_header header; + uint8_t index; + struct zmk_ble_profile *profile; +}; + +ZMK_EVENT_DECLARE(ble_active_profile_changed); diff --git a/app/include/zmk/events/keycode-state-changed.h b/app/include/zmk/events/keycode-state-changed.h deleted file mode 100644 index 7dc87e2..0000000 --- a/app/include/zmk/events/keycode-state-changed.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2020 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ - -#pragma once - -#include -#include -#include -#include -#include - -struct keycode_state_changed { - struct zmk_event_header header; - uint8_t usage_page; - uint32_t keycode; - uint8_t implicit_modifiers; - bool state; - int64_t timestamp; -}; - -ZMK_EVENT_DECLARE(keycode_state_changed); - -static inline struct keycode_state_changed * -keycode_state_changed_from_encoded(uint32_t encoded, bool pressed, int64_t timestamp) { - uint16_t page = HID_USAGE_PAGE(encoded) & 0xFF; - uint16_t id = HID_USAGE_ID(encoded); - zmk_mod_flags implicit_mods = SELECT_MODS(encoded); - - if (!page) { - page = HID_USAGE_KEY; - } - - struct keycode_state_changed *ev = new_keycode_state_changed(); - ev->usage_page = page; - ev->keycode = id; - ev->implicit_modifiers = implicit_mods; - ev->state = pressed; - ev->timestamp = timestamp; - return ev; -} diff --git a/app/include/zmk/events/keycode_state_changed.h b/app/include/zmk/events/keycode_state_changed.h new file mode 100644 index 0000000..28282b6 --- /dev/null +++ b/app/include/zmk/events/keycode_state_changed.h @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2020 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#pragma once + +#include +#include +#include +#include +#include + +struct keycode_state_changed { + struct zmk_event_header header; + uint8_t usage_page; + uint32_t keycode; + uint8_t implicit_modifiers; + bool state; + int64_t timestamp; +}; + +ZMK_EVENT_DECLARE(keycode_state_changed); + +static inline struct keycode_state_changed * +keycode_state_changed_from_encoded(uint32_t encoded, bool pressed, int64_t timestamp) { + uint16_t page = HID_USAGE_PAGE(encoded) & 0xFF; + uint16_t id = HID_USAGE_ID(encoded); + zmk_mod_flags implicit_mods = SELECT_MODS(encoded); + + if (!page) { + page = HID_USAGE_KEY; + } + + struct keycode_state_changed *ev = new_keycode_state_changed(); + ev->usage_page = page; + ev->keycode = id; + ev->implicit_modifiers = implicit_mods; + ev->state = pressed; + ev->timestamp = timestamp; + return ev; +} diff --git a/app/include/zmk/events/layer-state-changed.h b/app/include/zmk/events/layer-state-changed.h deleted file mode 100644 index 352c602..0000000 --- a/app/include/zmk/events/layer-state-changed.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2020 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ - -#pragma once - -#include -#include - -struct layer_state_changed { - struct zmk_event_header header; - uint8_t layer; - bool state; - int64_t timestamp; -}; - -ZMK_EVENT_DECLARE(layer_state_changed); - -static inline struct layer_state_changed *create_layer_state_changed(uint8_t layer, bool state) { - struct layer_state_changed *ev = new_layer_state_changed(); - ev->layer = layer; - ev->state = state; - ev->timestamp = k_uptime_get(); - - return ev; -} diff --git a/app/include/zmk/events/layer_state_changed.h b/app/include/zmk/events/layer_state_changed.h new file mode 100644 index 0000000..cf24002 --- /dev/null +++ b/app/include/zmk/events/layer_state_changed.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2020 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#pragma once + +#include +#include + +struct layer_state_changed { + struct zmk_event_header header; + uint8_t layer; + bool state; + int64_t timestamp; +}; + +ZMK_EVENT_DECLARE(layer_state_changed); + +static inline struct layer_state_changed *create_layer_state_changed(uint8_t layer, bool state) { + struct layer_state_changed *ev = new_layer_state_changed(); + ev->layer = layer; + ev->state = state; + ev->timestamp = k_uptime_get(); + + return ev; +} diff --git a/app/include/zmk/events/modifiers-state-changed.h b/app/include/zmk/events/modifiers-state-changed.h deleted file mode 100644 index d2e02f8..0000000 --- a/app/include/zmk/events/modifiers-state-changed.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2020 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ - -#pragma once - -#include -#include -#include - -struct modifiers_state_changed { - struct zmk_event_header header; - zmk_mod_flags modifiers; - bool state; -}; - -ZMK_EVENT_DECLARE(modifiers_state_changed); - -inline struct modifiers_state_changed *create_modifiers_state_changed(zmk_mod_flags modifiers, - bool state) { - struct modifiers_state_changed *ev = new_modifiers_state_changed(); - ev->modifiers = modifiers; - ev->state = state; - - return ev; -} \ No newline at end of file diff --git a/app/include/zmk/events/modifiers_state_changed.h b/app/include/zmk/events/modifiers_state_changed.h new file mode 100644 index 0000000..c4daede --- /dev/null +++ b/app/include/zmk/events/modifiers_state_changed.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2020 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#pragma once + +#include +#include +#include + +struct modifiers_state_changed { + struct zmk_event_header header; + zmk_mod_flags modifiers; + bool state; +}; + +ZMK_EVENT_DECLARE(modifiers_state_changed); + +inline struct modifiers_state_changed *create_modifiers_state_changed(zmk_mod_flags modifiers, + bool state) { + struct modifiers_state_changed *ev = new_modifiers_state_changed(); + ev->modifiers = modifiers; + ev->state = state; + + return ev; +} \ No newline at end of file diff --git a/app/include/zmk/events/position-state-changed.h b/app/include/zmk/events/position-state-changed.h deleted file mode 100644 index 7058276..0000000 --- a/app/include/zmk/events/position-state-changed.h +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2020 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ - -#pragma once - -#include -#include - -struct position_state_changed { - struct zmk_event_header header; - uint32_t position; - bool state; - int64_t timestamp; -}; - -ZMK_EVENT_DECLARE(position_state_changed); \ No newline at end of file diff --git a/app/include/zmk/events/position_state_changed.h b/app/include/zmk/events/position_state_changed.h new file mode 100644 index 0000000..0f1ac1b --- /dev/null +++ b/app/include/zmk/events/position_state_changed.h @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2020 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#pragma once + +#include +#include + +struct position_state_changed { + struct zmk_event_header header; + uint32_t position; + bool state; + int64_t timestamp; +}; + +ZMK_EVENT_DECLARE(position_state_changed); \ No newline at end of file diff --git a/app/include/zmk/events/sensor-event.h b/app/include/zmk/events/sensor-event.h deleted file mode 100644 index 0bd3ccf..0000000 --- a/app/include/zmk/events/sensor-event.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2020 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ - -#pragma once - -#include -#include -#include - -struct sensor_event { - struct zmk_event_header header; - uint8_t sensor_number; - const struct device *sensor; - int64_t timestamp; -}; - -ZMK_EVENT_DECLARE(sensor_event); \ No newline at end of file diff --git a/app/include/zmk/events/sensor_event.h b/app/include/zmk/events/sensor_event.h new file mode 100644 index 0000000..14fb2d3 --- /dev/null +++ b/app/include/zmk/events/sensor_event.h @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2020 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#pragma once + +#include +#include +#include + +struct sensor_event { + struct zmk_event_header header; + uint8_t sensor_number; + const struct device *sensor; + int64_t timestamp; +}; + +ZMK_EVENT_DECLARE(sensor_event); \ No newline at end of file diff --git a/app/include/zmk/events/usb-conn-state-changed.h b/app/include/zmk/events/usb-conn-state-changed.h deleted file mode 100644 index d6cc698..0000000 --- a/app/include/zmk/events/usb-conn-state-changed.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2020 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ - -#pragma once - -#include -#include - -#include -#include - -struct usb_conn_state_changed { - struct zmk_event_header header; - enum zmk_usb_conn_state conn_state; -}; - -ZMK_EVENT_DECLARE(usb_conn_state_changed); \ No newline at end of file diff --git a/app/include/zmk/events/usb_conn_state_changed.h b/app/include/zmk/events/usb_conn_state_changed.h new file mode 100644 index 0000000..b38fb9f --- /dev/null +++ b/app/include/zmk/events/usb_conn_state_changed.h @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2020 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#pragma once + +#include +#include + +#include +#include + +struct usb_conn_state_changed { + struct zmk_event_header header; + enum zmk_usb_conn_state conn_state; +}; + +ZMK_EVENT_DECLARE(usb_conn_state_changed); \ No newline at end of file -- cgit v1.2.3