refactor: All SYS_INIT functions are void args.
This commit is contained in:
parent
49b37c58d5
commit
9b711e9bea
16 changed files with 16 additions and 17 deletions
|
@ -11,8 +11,7 @@
|
||||||
#include <zephyr/sys/sys_io.h>
|
#include <zephyr/sys/sys_io.h>
|
||||||
#include <zephyr/devicetree.h>
|
#include <zephyr/devicetree.h>
|
||||||
|
|
||||||
static int pinmux_mikoto_init(const struct device *port) {
|
static int pinmux_mikoto_init(void) {
|
||||||
ARG_UNUSED(port);
|
|
||||||
|
|
||||||
#if CONFIG_BOARD_MIKOTO_520
|
#if CONFIG_BOARD_MIKOTO_520
|
||||||
const struct device *p0 = DEVICE_DT_GET(DT_NODELABEL(gpio0));
|
const struct device *p0 = DEVICE_DT_GET(DT_NODELABEL(gpio0));
|
||||||
|
|
|
@ -84,7 +84,7 @@ void activity_expiry_function() { k_work_submit(&activity_work); }
|
||||||
|
|
||||||
K_TIMER_DEFINE(activity_timer, activity_expiry_function, NULL);
|
K_TIMER_DEFINE(activity_timer, activity_expiry_function, NULL);
|
||||||
|
|
||||||
int activity_init() {
|
int activity_init(void) {
|
||||||
activity_last_uptime = k_uptime_get();
|
activity_last_uptime = k_uptime_get();
|
||||||
|
|
||||||
k_timer_start(&activity_timer, K_SECONDS(1), K_SECONDS(1));
|
k_timer_start(&activity_timer, K_SECONDS(1), K_SECONDS(1));
|
||||||
|
|
|
@ -78,7 +78,7 @@ static void backlight_save_work_handler(struct k_work *work) {
|
||||||
static struct k_work_delayable backlight_save_work;
|
static struct k_work_delayable backlight_save_work;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int zmk_backlight_init(const struct device *_arg) {
|
static int zmk_backlight_init(void) {
|
||||||
if (!device_is_ready(backlight_dev)) {
|
if (!device_is_ready(backlight_dev)) {
|
||||||
LOG_ERR("Backlight device \"%s\" is not ready", backlight_dev->name);
|
LOG_ERR("Backlight device \"%s\" is not ready", backlight_dev->name);
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
|
@ -84,7 +84,7 @@ static void zmk_battery_timer(struct k_timer *timer) {
|
||||||
|
|
||||||
K_TIMER_DEFINE(battery_timer, zmk_battery_timer, NULL);
|
K_TIMER_DEFINE(battery_timer, zmk_battery_timer, NULL);
|
||||||
|
|
||||||
static int zmk_battery_init(const struct device *_arg) {
|
static int zmk_battery_init(void) {
|
||||||
#if !DT_HAS_CHOSEN(zmk_battery)
|
#if !DT_HAS_CHOSEN(zmk_battery)
|
||||||
battery = device_get_binding("BATTERY");
|
battery = device_get_binding("BATTERY");
|
||||||
|
|
||||||
|
|
|
@ -582,7 +582,7 @@ static void zmk_ble_ready(int err) {
|
||||||
update_advertising();
|
update_advertising();
|
||||||
}
|
}
|
||||||
|
|
||||||
static int zmk_ble_init(const struct device *_arg) {
|
static int zmk_ble_init(void) {
|
||||||
int err = bt_enable(NULL);
|
int err = bt_enable(NULL);
|
||||||
|
|
||||||
if (err) {
|
if (err) {
|
||||||
|
|
|
@ -537,7 +537,7 @@ ZMK_SUBSCRIPTION(combo, zmk_keycode_state_changed);
|
||||||
|
|
||||||
DT_INST_FOREACH_CHILD(0, COMBO_INST)
|
DT_INST_FOREACH_CHILD(0, COMBO_INST)
|
||||||
|
|
||||||
static int combo_init() {
|
static int combo_init(void) {
|
||||||
k_work_init_delayable(&timeout_task, combo_timeout_handler);
|
k_work_init_delayable(&timeout_task, combo_timeout_handler);
|
||||||
DT_INST_FOREACH_CHILD(0, INITIALIZE_COMBO);
|
DT_INST_FOREACH_CHILD(0, INITIALIZE_COMBO);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -302,7 +302,7 @@ static struct zmk_endpoint_instance get_selected_instance(void) {
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int zmk_endpoints_init(const struct device *_arg) {
|
static int zmk_endpoints_init(void) {
|
||||||
#if IS_ENABLED(CONFIG_SETTINGS)
|
#if IS_ENABLED(CONFIG_SETTINGS)
|
||||||
settings_subsys_init();
|
settings_subsys_init();
|
||||||
|
|
||||||
|
|
|
@ -341,7 +341,7 @@ int zmk_hog_send_mouse_report(struct zmk_hid_mouse_report_body *report) {
|
||||||
|
|
||||||
#endif // IS_ENABLED(CONFIG_ZMK_MOUSE)
|
#endif // IS_ENABLED(CONFIG_ZMK_MOUSE)
|
||||||
|
|
||||||
int zmk_hog_init(const struct device *_arg) {
|
int zmk_hog_init(void) {
|
||||||
static const struct k_work_queue_config queue_config = {.name = "HID Over GATT Send Work"};
|
static const struct k_work_queue_config queue_config = {.name = "HID Over GATT Send Work"};
|
||||||
k_work_queue_start(&hog_work_q, hog_q_stack, K_THREAD_STACK_SIZEOF(hog_q_stack),
|
k_work_queue_start(&hog_work_q, hog_q_stack, K_THREAD_STACK_SIZEOF(hog_q_stack),
|
||||||
CONFIG_ZMK_BLE_THREAD_PRIORITY, &queue_config);
|
CONFIG_ZMK_BLE_THREAD_PRIORITY, &queue_config);
|
||||||
|
|
|
@ -239,7 +239,7 @@ static void zmk_rgb_underglow_save_state_work() {
|
||||||
static struct k_work_delayable underglow_save_work;
|
static struct k_work_delayable underglow_save_work;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int zmk_rgb_underglow_init(const struct device *_arg) {
|
static int zmk_rgb_underglow_init(void) {
|
||||||
led_strip = DEVICE_DT_GET(STRIP_CHOSEN);
|
led_strip = DEVICE_DT_GET(STRIP_CHOSEN);
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_ZMK_RGB_UNDERGLOW_EXT_POWER)
|
#if IS_ENABLED(CONFIG_ZMK_RGB_UNDERGLOW_EXT_POWER)
|
||||||
|
|
|
@ -140,7 +140,7 @@ static void zmk_sensors_init_item(uint8_t i) {
|
||||||
|
|
||||||
#define SENSOR_INIT(idx, _t) zmk_sensors_init_item(idx);
|
#define SENSOR_INIT(idx, _t) zmk_sensors_init_item(idx);
|
||||||
|
|
||||||
static int zmk_sensors_init(const struct device *_arg) {
|
static int zmk_sensors_init(void) {
|
||||||
LISTIFY(ZMK_KEYMAP_SENSORS_LEN, SENSOR_INIT, (), 0)
|
LISTIFY(ZMK_KEYMAP_SENSORS_LEN, SENSOR_INIT, (), 0)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -685,7 +685,7 @@ int zmk_split_bt_invoke_behavior(uint8_t source, struct zmk_behavior_binding *bi
|
||||||
return split_bt_invoke_behavior_payload(wrapper);
|
return split_bt_invoke_behavior_payload(wrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
int zmk_split_bt_central_init(const struct device *_arg) {
|
static int zmk_split_bt_central_init(void) {
|
||||||
k_work_queue_start(&split_central_split_run_q, split_central_split_run_q_stack,
|
k_work_queue_start(&split_central_split_run_q, split_central_split_run_q_stack,
|
||||||
K_THREAD_STACK_SIZEOF(split_central_split_run_q_stack),
|
K_THREAD_STACK_SIZEOF(split_central_split_run_q_stack),
|
||||||
CONFIG_ZMK_BLE_THREAD_PRIORITY, NULL);
|
CONFIG_ZMK_BLE_THREAD_PRIORITY, NULL);
|
||||||
|
|
|
@ -134,7 +134,7 @@ static struct bt_conn_cb conn_callbacks = {
|
||||||
|
|
||||||
bool zmk_split_bt_peripheral_is_connected() { return is_connected; }
|
bool zmk_split_bt_peripheral_is_connected() { return is_connected; }
|
||||||
|
|
||||||
static int zmk_peripheral_ble_init(const struct device *_arg) {
|
static int zmk_peripheral_ble_init(void) {
|
||||||
int err = bt_enable(NULL);
|
int err = bt_enable(NULL);
|
||||||
|
|
||||||
if (err) {
|
if (err) {
|
||||||
|
|
|
@ -227,7 +227,7 @@ int zmk_split_bt_sensor_triggered(uint8_t sensor_index,
|
||||||
}
|
}
|
||||||
#endif /* ZMK_KEYMAP_HAS_SENSORS */
|
#endif /* ZMK_KEYMAP_HAS_SENSORS */
|
||||||
|
|
||||||
int service_init(const struct device *_arg) {
|
static int service_init(void) {
|
||||||
static const struct k_work_queue_config queue_config = {
|
static const struct k_work_queue_config queue_config = {
|
||||||
.name = "Split Peripheral Notification Queue"};
|
.name = "Split Peripheral Notification Queue"};
|
||||||
k_work_queue_start(&service_work_q, service_q_stack, K_THREAD_STACK_SIZEOF(service_q_stack),
|
k_work_queue_start(&service_work_q, service_q_stack, K_THREAD_STACK_SIZEOF(service_q_stack),
|
||||||
|
|
|
@ -65,7 +65,7 @@ void usb_status_cb(enum usb_dc_status_code status, const uint8_t *params) {
|
||||||
k_work_submit(&usb_status_notifier_work);
|
k_work_submit(&usb_status_notifier_work);
|
||||||
};
|
};
|
||||||
|
|
||||||
static int zmk_usb_init(const struct device *_arg) {
|
static int zmk_usb_init(void) {
|
||||||
int usb_enable_ret;
|
int usb_enable_ret;
|
||||||
|
|
||||||
usb_enable_ret = usb_enable(usb_status_cb);
|
usb_enable_ret = usb_enable(usb_status_cb);
|
||||||
|
|
|
@ -142,7 +142,7 @@ int zmk_usb_hid_send_mouse_report() {
|
||||||
}
|
}
|
||||||
#endif // IS_ENABLED(CONFIG_ZMK_MOUSE)
|
#endif // IS_ENABLED(CONFIG_ZMK_MOUSE)
|
||||||
|
|
||||||
static int zmk_usb_hid_init(const struct device *_arg) {
|
static int zmk_usb_hid_init(void) {
|
||||||
hid_dev = device_get_binding("HID_0");
|
hid_dev = device_get_binding("HID_0");
|
||||||
if (hid_dev == NULL) {
|
if (hid_dev == NULL) {
|
||||||
LOG_ERR("Unable to locate HID device");
|
LOG_ERR("Unable to locate HID device");
|
||||||
|
|
|
@ -72,7 +72,7 @@ void wpm_expiry_function() { k_work_submit(&wpm_work); }
|
||||||
|
|
||||||
K_TIMER_DEFINE(wpm_timer, wpm_expiry_function, NULL);
|
K_TIMER_DEFINE(wpm_timer, wpm_expiry_function, NULL);
|
||||||
|
|
||||||
int wpm_init() {
|
static int wpm_init(void) {
|
||||||
wpm_state = 0;
|
wpm_state = 0;
|
||||||
wpm_update_counter = 0;
|
wpm_update_counter = 0;
|
||||||
k_timer_start(&wpm_timer, K_SECONDS(WPM_UPDATE_INTERVAL_SECONDS),
|
k_timer_start(&wpm_timer, K_SECONDS(WPM_UPDATE_INTERVAL_SECONDS),
|
||||||
|
|
Loading…
Add table
Reference in a new issue