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

uint8_t IO_LPS22HB::status(uint8_t status) never returns a negative #7

Open
reefwing opened this issue Feb 13, 2023 · 0 comments
Open

Comments

@reefwing
Copy link

I don't think the private status function works as you expect. It returns a uint8_t which is never < 0. Thus the tests in readPressure() and readTemperature() are never true, i.e.,

if (status(0x1) < 0)
		return 1.23;

If you assign -1 to a uint8_t I think it interprets this as 255. You need to change the status return type to an int.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant