Skip to content

Commit ba8d29e

Browse files
committed
Cleanup + clang-format
1 parent 929a910 commit ba8d29e

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

src/Primitives/zephyr.cpp

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -428,20 +428,13 @@ def_prim_serialize(drive_motor_degrees) {
428428
}
429429
}
430430

431-
/*const struct device *const uart_specs[] = {
432-
DEVICE_DT_GET(DT_PHANDLE_BY_IDX(DT_PATH(zephyr_user), warduino_uarts, 0)),
433-
DEVICE_DT_GET(DT_PHANDLE_BY_IDX(DT_PATH(zephyr_user), warduino_uarts, 1)),
434-
DEVICE_DT_GET(DT_PHANDLE_BY_IDX(DT_PATH(zephyr_user), warduino_uarts, 2)),
435-
DEVICE_DT_GET(DT_PHANDLE_BY_IDX(DT_PATH(zephyr_user), warduino_uarts, 3)),
436-
};*/
437-
438-
#define UART_ENTRY(idx, _) DEVICE_DT_GET(DT_PHANDLE_BY_IDX(DT_PATH(zephyr_user), warduino_uarts, idx))
439-
const device *const uart_specs[] = {
440-
LISTIFY(DT_PROP_LEN(DT_PATH(zephyr_user), warduino_uarts), UART_ENTRY, (,))
441-
};
431+
#define UART_ENTRY(idx, _) \
432+
DEVICE_DT_GET(DT_PHANDLE_BY_IDX(DT_PATH(zephyr_user), warduino_uarts, idx))
433+
const device *const uart_devs[] = {LISTIFY(
434+
DT_PROP_LEN(DT_PATH(zephyr_user), warduino_uarts), UART_ENTRY, (, ))};
442435

443-
UartSensor sensors[] = {UartSensor(uart_specs[0]), UartSensor(uart_specs[1]),
444-
UartSensor(uart_specs[2]), UartSensor(uart_specs[3])};
436+
UartSensor sensors[] = {UartSensor(uart_devs[0]), UartSensor(uart_devs[1]),
437+
UartSensor(uart_devs[2]), UartSensor(uart_devs[3])};
445438

446439
def_prim(setup_uart_sensor, twoToNoneU32) {
447440
printf("get sensor %d\n", arg1.uint32);

0 commit comments

Comments
 (0)