Skip to content

Resistance to hardware malfunction Hotfix #1

@LennardBoediger

Description

@LennardBoediger

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions