-
Notifications
You must be signed in to change notification settings - Fork 1.5k
drivers/sensors: add a new sensor type ENG #17837
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
base: master
Are you sure you want to change the base?
Conversation
|
TODO: codespell :-) |
b09c37a to
00244a6
Compare
Done |
|
Thank you @Otpvondoiats :-) I am not sure if changing numbers for other sensors is okay each time when we add a new type @linguini1 ? Wouldn't that bring some debug / log / recording issues?:-) |
cederom
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @Otpvondoiats :-)
- Let's just make sure CU builds fine.
- After this PR is merged apache/nuttx-apps#3312 should follow.
In theory I don't think it matters, but I think this should be added at the end of the list without changing any numbers because it clutters the diff and blame history. |
linguini1
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add the new type at the bottom of the list to avoid changing the numerical values of other types.
jerpelea
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please fix the commit title typo
drivers/sensors
|
@Otpvondoiats I think when adding a new type of sensor it is not a good idea to change the previous sensor type IDs, if someone is using system in protected mode or kernel mode and updating only the kernel the sensor applications will break. So considering it, this PR is a breaking change |
|
@Otpvondoiats which Electroneurography sensor are you using to test it? |
|
Thank you folks that was exactly my feeling about the numbers :-) |
done
xiaomi watch 5 https://www.youtube.com/watch?v=PQh7yKgPQyY |
It won't have any impact; the |
The |
cederom
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add new sensor type to the end of the existing sensors identifiers, thanks :-)
"eng" needs to be placed in this position. The order of the types does not affect the use by external users. For users, it is a macro that is being used. If numbers are used, then what is the point of defining a macro? |
|
What if you record a data stream / log with these identifiers, use current code to decode it, then someone changes the numbers and you want to decode old recording with a new code? What if the application and kernel versions mismatch and they contain different identifiers for the same sensor? 3 people are telling you that this is bad practice to add one new thing and break everything around.. usually you append new identifiers to the end of exiting list so that existing identifiers are untouched ;-) |
nuttx: |
|
If Android is considered standard's upstream and NuttX has more new identifiers it may be good to provide these identifiers to the upstream so the world uses the same identifiers, even if unimplemented on their side, correct? You can try and see would Google say if you add EMP to their existing list as number 5 and increment all following existing id defines. I have no more comments here. |
I've already replied above. The "eng" case is special; he was the previous owner and forgot to upload it. The ID position is now set to 48. Subsequent new sensor types will be placed at the end, before the GNSS module. The order will only change if new types are added for alignment purposes in Android. Gnss is a special module, so put it at the end. |
6dcf664
Add a new sensor type for ENG sensor. Signed-off-by: liucheng5 <[email protected]> Signed-off-by: likun17 <[email protected]>
Following your idea, the difference in type id will not be sorted. |
Summary
Provides: apache/nuttx-apps#3312.
Impact
Testing
We have conducted tests on the following platforms:
Simulator - single core:pass
BES Platform - multi-core:pass;
Platform - xiaomi watch 5