Skip to content
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

Merged
merged 2 commits into from
Jan 7, 2015
Merged

Device Driver for TMP006 Sensor #2148

merged 2 commits into from
Jan 7, 2015

Conversation

jfischer-no
Copy link
Contributor

This PR add support for TI TMP006 Infrared Thermopile Sensor.

@LudwigKnuepfer LudwigKnuepfer added Area: drivers Area: Device drivers Type: new feature The issue requests / The PR implemements a new feature for RIOT labels Dec 5, 2014
#define TMP006_CCONST_B2 4.63E-9
#define TMP006_CCONST_C2 13.4
#define TMP006_CCONST_LSB_SIZE 156.25E-9

Copy link
Member

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?

Copy link
Contributor Author

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.

@PeterKietzmann
Copy link
Member

This one looks goog to me. Will test when the hardware arrives :-)


*drdy = buf[1] & (uint8_t)(TMP006_CONFIG_DRDY);

if (!drdy) {
Copy link

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.

Copy link
Contributor Author

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))

Copy link

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 ;)

@PeterKietzmann
Copy link
Member

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.

@PeterKietzmann
Copy link
Member

@jfischer-phytec-iot I think you did really great work! Acking all your PRs does not seem far.

@OlegHahm OlegHahm added the Community: Hack'n'ACK candidate This PR is a candidate for review and discussion during one of RIOT's monthly Hack'n'ACK parties label Jan 6, 2015
@PeterKietzmann
Copy link
Member

vtimer works now. Needs squashing and waiting for #2059 to be merged. Then I'll give my final ACK.

@OlegHahm
Copy link
Member

OlegHahm commented Jan 7, 2015

@PeterKietzmann, I think we could merge it independent from #2059.

@PeterKietzmann
Copy link
Member

Okay, if you are happy with the formalities I'm too. Was just wondering if it's strange to merge an application for a board that is not in master. This also applies to #2119, #2121 and #2123.

@PeterKietzmann
Copy link
Member

Let's go

PeterKietzmann added a commit that referenced this pull request Jan 7, 2015
@PeterKietzmann PeterKietzmann merged commit 076706f into RIOT-OS:master Jan 7, 2015
@jfischer-no jfischer-no deleted the pr@tmp006 branch January 31, 2015 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: drivers Area: Device drivers Community: Hack'n'ACK candidate This PR is a candidate for review and discussion during one of RIOT's monthly Hack'n'ACK parties Type: new feature The issue requests / The PR implemements a new feature for RIOT
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants