zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
9.91k stars 6.1k forks source link

sensor: sensor_shell: split DXYZ & remove decoding redirection #72841

Closed ycsin closed 1 week ago

ycsin commented 4 weeks ago

[!NOTE] This (draft) PR doesn't fix #72840 completely (well, it fixed something by breaking something as now the 3d channels doesn't work). I'm not going to pursue this further and will leave this to the hands of the RTIO/sensor maintainers.

Only the last commit of this PR is relevant: cc7d489c281b31e95c644d9322fee3182d390124, the others are just commits from other PRs that have been merged.


Attempts to fix #72840

Apart from the 3-dimensional data, everything else works.

uart:~$ sensor get sensor@0 0
channel type=0(accel_x) index=0 shift=0 num_samples=1 value=9220133425350000000ns (0.000000)
uart:~$ sensor get sensor@0 1
channel type=1(accel_y) index=0 shift=1 num_samples=1 value=9220133425350000000ns (1.000000)
uart:~$ sensor get sensor@0 2
channel type=2(accel_z) index=0 shift=2 num_samples=1 value=9220133425350000000ns (2.000000)
uart:~$ sensor get sensor@0 3
channel type=0(accel_x) index=0 shift=2 num_samples=1 value=9220133425350000000ns (3.000000)
uart:~$ sensor get sensor@0 4
channel type=4(gyro_x) index=0 shift=3 num_samples=1 value=9220133425350000000ns (4.000000)
uart:~$ sensor get sensor@0 5
channel type=5(gyro_y) index=0 shift=3 num_samples=1 value=9220133425350000000ns (5.000000)
uart:~$ sensor get sensor@0 6
channel type=6(gyro_z) index=0 shift=3 num_samples=1 value=9220133425350000000ns (6.000000)
uart:~$ sensor get sensor@0 7
channel type=4(gyro_x) index=0 shift=3 num_samples=1 value=9220133425350000000ns (7.000000)
uart:~$ sensor get sensor@0 8
channel type=8(magn_x) index=0 shift=4 num_samples=1 value=9220133425350000000ns (8.000000)
uart:~$ sensor get sensor@0 9
channel type=9(magn_y) index=0 shift=4 num_samples=1 value=9220133425350000000ns (9.000000)
uart:~$ sensor get sensor@0 10
channel type=10(magn_z) index=0 shift=4 num_samples=1 value=9220133425350000000ns (10.000000)
uart:~$ sensor get sensor@0 11
channel type=8(magn_x) index=0 shift=4 num_samples=1 value=9220133425350000000ns (11.000000)
nashif commented 1 week ago

please rebase

ycsin commented 1 week ago

please rebase

This (draft) PR doesn't fix #72840 completely (well, it fixed something by breaking something as now the 3d channels doesn't work). I'm not going to pursue this further and will leave this to the hands of the RTIO/sensor maintainers.

Only the last commit of this PR is relevant: cc7d489c281b31e95c644d9322fee3182d390124, the others are just commits from other PRs that have been merged.