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

Resistance to hardware malfunction Hotfix #1

Open
LennardBoediger opened this issue Jun 18, 2021 · 0 comments
Open

Resistance to hardware malfunction Hotfix #1

LennardBoediger opened this issue Jun 18, 2021 · 0 comments

Comments

@LennardBoediger
Copy link
Owner

LennardBoediger commented Jun 18, 2021

while (dataAvailable(fd) == 0) delay(POLLING_DELAY); //Potential TODO: avoid this to get faster nearly parralel mesurments

A defective sensor appears to not change its state. Use this Hotfix to prevent the software from stopping completely

int i = 0;
while (dataAvailable(fd) == 0){
	if(i < TIMEOUT_COUNTER){
		printf("Measurement at sensor timeout do not trust that received data is new");
break;
	}
	delay(POLLING_DELAY); //Potential TODO: avoid this to get faster nearly parralel mesurments
	i++;
}

Attantion dataAvailable is a register on the sensor that indicates that the measurement is finished and ready to be read from the sensor.
Not waiting for this may result in old data being read.

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