@@ -428,20 +428,13 @@ def_prim_serialize(drive_motor_degrees) {
428
428
}
429
429
}
430
430
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, (, ))};
442
435
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 ])};
445
438
446
439
def_prim (setup_uart_sensor, twoToNoneU32) {
447
440
printf (" get sensor %d\n " , arg1.uint32 );
0 commit comments