I see a lot of functions in the code where the return statement is missing or is kept inside if blocks that may not execute. I am very surprised to see such badly written code which doesn't conform to any standards. Does anyone know the reasoning for this?
An example:
uint8_t EVShieldBank::motorWaitUntilTachoDone(SH_Motor which_motors)
{
uint8_t s;
delay(50); // this delay is required for the status byte to be available for reading.
s = motorIsTachoDone(which_motors);
while (( s & SH_STATUS_TACHO ) != 0 ) {
delay (50);
s = motorIsTachoDone(which_motors);
}
}
I see a lot of functions in the code where the return statement is missing or is kept inside if blocks that may not execute. I am very surprised to see such badly written code which doesn't conform to any standards. Does anyone know the reasoning for this?
An example: