forked from kofal.net/zmk
chore: clang-format the codebase.
* Use the LLVM style * Override indent width (8) and column limit (100) * Fixes #142.
This commit is contained in:
@@ -19,19 +19,20 @@
|
||||
* (Internal use only.)
|
||||
*/
|
||||
|
||||
typedef int (*behavior_keymap_binding_callback_t)(struct device *dev, u32_t position, u32_t param1, u32_t param2);
|
||||
typedef int (*behavior_sensor_keymap_binding_callback_t)(struct device *dev, struct device *sensor, u32_t param1, u32_t param2);
|
||||
typedef int (*behavior_keymap_binding_callback_t)(struct device *dev, u32_t position, u32_t param1,
|
||||
u32_t param2);
|
||||
typedef int (*behavior_sensor_keymap_binding_callback_t)(struct device *dev, struct device *sensor,
|
||||
u32_t param1, u32_t param2);
|
||||
|
||||
__subsystem struct behavior_driver_api {
|
||||
behavior_keymap_binding_callback_t binding_pressed;
|
||||
behavior_keymap_binding_callback_t binding_released;
|
||||
behavior_sensor_keymap_binding_callback_t sensor_binding_triggered;
|
||||
behavior_keymap_binding_callback_t binding_pressed;
|
||||
behavior_keymap_binding_callback_t binding_released;
|
||||
behavior_sensor_keymap_binding_callback_t sensor_binding_triggered;
|
||||
};
|
||||
/**
|
||||
* @endcond
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @brief Handle the keymap binding being pressed
|
||||
* @param dev Pointer to the device structure for the driver instance.
|
||||
@@ -41,18 +42,18 @@ __subsystem struct behavior_driver_api {
|
||||
* @retval 0 If successful.
|
||||
* @retval Negative errno code if failure.
|
||||
*/
|
||||
__syscall int behavior_keymap_binding_pressed(struct device *dev, u32_t position, u32_t param1, u32_t param2);
|
||||
__syscall int behavior_keymap_binding_pressed(struct device *dev, u32_t position, u32_t param1,
|
||||
u32_t param2);
|
||||
|
||||
static inline int z_impl_behavior_keymap_binding_pressed(struct device *dev, u32_t position, u32_t param1, u32_t param2)
|
||||
{
|
||||
const struct behavior_driver_api *api =
|
||||
(const struct behavior_driver_api *)dev->driver_api;
|
||||
static inline int z_impl_behavior_keymap_binding_pressed(struct device *dev, u32_t position,
|
||||
u32_t param1, u32_t param2) {
|
||||
const struct behavior_driver_api *api = (const struct behavior_driver_api *)dev->driver_api;
|
||||
|
||||
if (api->binding_pressed == NULL) {
|
||||
return -ENOTSUP;
|
||||
}
|
||||
if (api->binding_pressed == NULL) {
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
return api->binding_pressed(dev, position, param1, param2);
|
||||
return api->binding_pressed(dev, position, param1, param2);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -63,18 +64,18 @@ static inline int z_impl_behavior_keymap_binding_pressed(struct device *dev, u32
|
||||
* @retval 0 If successful.
|
||||
* @retval Negative errno code if failure.
|
||||
*/
|
||||
__syscall int behavior_keymap_binding_released(struct device *dev, u32_t position, u32_t param1, u32_t param2);
|
||||
__syscall int behavior_keymap_binding_released(struct device *dev, u32_t position, u32_t param1,
|
||||
u32_t param2);
|
||||
|
||||
static inline int z_impl_behavior_keymap_binding_released(struct device *dev, u32_t position, u32_t param1, u32_t param2)
|
||||
{
|
||||
const struct behavior_driver_api *api =
|
||||
(const struct behavior_driver_api *)dev->driver_api;
|
||||
static inline int z_impl_behavior_keymap_binding_released(struct device *dev, u32_t position,
|
||||
u32_t param1, u32_t param2) {
|
||||
const struct behavior_driver_api *api = (const struct behavior_driver_api *)dev->driver_api;
|
||||
|
||||
if (api->binding_released == NULL) {
|
||||
return -ENOTSUP;
|
||||
}
|
||||
if (api->binding_released == NULL) {
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
return api->binding_released(dev, position, param1, param2);
|
||||
return api->binding_released(dev, position, param1, param2);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -87,21 +88,21 @@ static inline int z_impl_behavior_keymap_binding_released(struct device *dev, u3
|
||||
* @retval 0 If successful.
|
||||
* @retval Negative errno code if failure.
|
||||
*/
|
||||
__syscall int behavior_sensor_keymap_binding_triggered(struct device *dev, struct device *sensor, u32_t param1, u32_t param2);
|
||||
__syscall int behavior_sensor_keymap_binding_triggered(struct device *dev, struct device *sensor,
|
||||
u32_t param1, u32_t param2);
|
||||
|
||||
static inline int z_impl_behavior_sensor_keymap_binding_triggered(struct device *dev, struct device *sensor, u32_t param1, u32_t param2)
|
||||
{
|
||||
const struct behavior_driver_api *api =
|
||||
(const struct behavior_driver_api *)dev->driver_api;
|
||||
static inline int z_impl_behavior_sensor_keymap_binding_triggered(struct device *dev,
|
||||
struct device *sensor,
|
||||
u32_t param1, u32_t param2) {
|
||||
const struct behavior_driver_api *api = (const struct behavior_driver_api *)dev->driver_api;
|
||||
|
||||
if (api->sensor_binding_triggered == NULL) {
|
||||
return -ENOTSUP;
|
||||
}
|
||||
if (api->sensor_binding_triggered == NULL) {
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
return api->sensor_binding_triggered(dev, sensor, param1, param2);
|
||||
return api->sensor_binding_triggered(dev, sensor, param1, param2);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user