-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Device Driver for TMP006 Sensor #2148
Conversation
#define TMP006_CCONST_B2 4.63E-9 | ||
#define TMP006_CCONST_C2 13.4 | ||
#define TMP006_CCONST_LSB_SIZE 156.25E-9 | ||
|
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.
Why didn't you define the registers in a/the header file?
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.
I was lazy to create a header file for these 5 registers. The constants can actually be moved to include/tmp006.h.
This one looks goog to me. Will test when the hardware arrives :-) |
|
||
*drdy = buf[1] & (uint8_t)(TMP006_CONFIG_DRDY); | ||
|
||
if (!drdy) { |
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.
cppcheck complains about this line:
drivers/tmp006/tmp006.c:189: warning (nullPointer): Possible null pointer dereference: drdy - otherwise it is redundant to check it against null.
Looks like a false positive to me (you don't check if it is a nullpointer but if the conversion is ready (at least that's what I get from reading the code/comments).
If I'm right you should suppress this warning.
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.
my error, if (!drdy) -> if (!(*drdy))
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.
That makes even more sense ;)
The application seems to work and runs stable even if I don't know where the offset comes from. Same as for your other drivers, waiting for vtimer bugfix. Also needs squashing like @LudwigOrtmann described in #2121. |
@jfischer-phytec-iot I think you did really great work! Acking all your PRs does not seem far. |
|
@PeterKietzmann, I think we could merge it independent from #2059. |
Let's go |
Device Driver for TMP006 Sensor
This PR add support for TI TMP006 Infrared Thermopile Sensor.