-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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
sensor: sensor_shell: split DXYZ & remove decoding redirection #72841
Draft
ycsin
wants to merge
9
commits into
zephyrproject-rtos:main
Choose a base branch
from
ycsin:pr/sensor_shell_chan
base: main
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+296
−145
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ycsin
force-pushed
the
pr/sensor_shell_chan
branch
from
May 16, 2024 06:52
12ba93d
to
f47b20f
Compare
ycsin
force-pushed
the
pr/sensor_shell_chan
branch
from
May 17, 2024 03:34
f47b20f
to
6cb389d
Compare
ycsin
changed the title
sensor: sensor_shell: split DXYZ & decoding redirection
sensor: sensor_shell: split DXYZ & remove decoding redirection
May 17, 2024
ycsin
force-pushed
the
pr/sensor_shell_chan
branch
2 times, most recently
from
May 17, 2024 04:23
aeec59d
to
57a75ac
Compare
Should increment `ch.chan_idx` instead of `channel_idx`, otherwise we will be stucked in the loop forever. Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Print something to the shell when the `trig` command completed successfully. Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Add a simple fake sensor driver so that the sample is more fun for boards without real sensor. Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Use pytest to test the shell commands. Signed-off-by: Yong Cong Sin <ycsin@meta.com>
The `SENSOR_CHAN_VSHUNT` was added in zephyrproject-rtos#60717 but was never added to the `sensor_channel_name[SENSOR_CHAN_COMMON_COUNT]` table. Since the length of `sensor_channel_name` is fixed to `SENSOR_CHAN_COMMON_COUNT`, this means that the index at `SENSOR_CHAN_VSHUNT` points to `NULL`. When we use the `sensor get` command for anything bigger than `SENSOR_CHAN_VSHUNT`, we will deref that `NULL` pointer when we do `strcmp` in the for-loop of `parse_named_int`. Fix this by defining `SENSOR_CHAN_VSHUNT` in the table. Signed-off-by: Yong Cong Sin <ycsin@meta.com>
If `CONFIG_SENSOR_INFO` is enabled, use the `sensor_info` section to validate that the argument is a sensor before using, otherwise the shell command will hang the application. Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Update the pytest script to exercise the entire `sensor_channel_name` table with `parse_named_int()`. The `gauge_desired_charging_current` is selected because it is the last one in the table before `all`, `all` is not used because `sensor get sensor@0 all` doesn't return anything. Signed-off-by: Yong Cong Sin <ycsin@meta.com>
As new channels are added to the `enum sensor_channel`, some of the newer channel aren't updated in the whitelist of rtio decoder. Instead of specifying every channel in the list, do: 1. Verify that the `channel` is valid 2. cherry-pick the channels that require special handling, i.e. 1. `three_axis_data` 2. `byte_data` 3. `uint64_data` 3. handle the remaining `channel` in the default case as `q31_data` to make sure that all channels are handled. Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Add `SENSOR_CHAN_POS_DXYZ` enum, and removed the redirection of axis to axes so that we can get the axis value correctly, i.e. ``` sensor get <sensor> accel_y ``` Signed-off-by: Yong Cong Sin <ycsin@meta.com>
ycsin
force-pushed
the
pr/sensor_shell_chan
branch
from
May 17, 2024 13:56
57a75ac
to
cc7d489
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Attempts to fix #72840
Apart from the 3-dimensional data, everything else works.