Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: drivers: build_all: input: Add config for futaba,sbus #79139

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions drivers/input/input_sbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#define DT_DRV_COMPAT futaba_sbus

#include <zephyr/device.h>
#include <zephyr/drivers/pinctrl.h>
#include <zephyr/input/input.h>
#include <zephyr/irq.h>
#include <zephyr/kernel.h>
Expand Down Expand Up @@ -356,17 +355,17 @@

#define INPUT_SBUS_INIT(n) \
\
static const struct sbus_input_channel input_##id[] = { \
static const struct sbus_input_channel input_##n[] = { \
DT_INST_FOREACH_CHILD(n, SBUS_INPUT_CHANNEL_INITIALIZER) \
}; \
DT_INST_FOREACH_CHILD(n, INPUT_CHANNEL_CHECK) \

Check notice on line 361 in drivers/input/input_sbus.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/input/input_sbus.c:361 - DT_INST_FOREACH_CHILD(n, SBUS_INPUT_CHANNEL_INITIALIZER) \ - }; \ + DT_INST_FOREACH_CHILD(n, SBUS_INPUT_CHANNEL_INITIALIZER)}; \
\
static struct input_sbus_data sbus_data_##n; \
\
static const struct input_sbus_config sbus_cfg_##n = { \
.channel_info = input_##id, \
.channel_info = input_##n, \
.uart_dev = DEVICE_DT_GET(DT_INST_BUS(n)), \
.num_channels = ARRAY_SIZE(input_##id), \
.num_channels = ARRAY_SIZE(input_##n), \
.cb = sbus_uart_isr, \
}; \
\
Expand Down
20 changes: 20 additions & 0 deletions tests/drivers/build_all/input/app.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* SPDX-License-Identifier: Apache-2.0
*/

#include <zephyr/dt-bindings/input/input-event-codes.h>

/ {
test {
#address-cells = <1>;
Expand Down Expand Up @@ -162,6 +164,24 @@
double-tap-delay-ms = <0>;
};

test_uart: uart@55556666 {
compatible = "vnd,serial";
reg = <0x55556666 0x1000>;
status = "okay";

#address-cells = <1>;
#size-cells = <0>;

sbus {
compatible = "futaba,sbus";
right_stick_x {
channel = <1>;
type = <INPUT_EV_ABS>;
zephyr,code = <INPUT_ABS_RX>;
};
};
};

i2c@1 {
#address-cells = <1>;
#size-cells = <0>;
Expand Down
2 changes: 2 additions & 0 deletions tests/drivers/build_all/input/prj.conf
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
CONFIG_GPIO=y
CONFIG_INPUT=y
CONFIG_SERIAL=y
CONFIG_UART_INTERRUPT_DRIVEN=y
Loading