-
Notifications
You must be signed in to change notification settings - Fork 7
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
Simplify Arduino code #22
Comments
In CS_comm.ino: As is now: int CS_checkresponse(String Str_exp) {
//compare intput string and string in input buffer
int respflag = 0;
/*
Serial.print("This just in ... ");
Serial.println(CS_inputBuffer);
Serial.print("expected ");
Serial.println(Str_exp);
*/
if (Str_exp == CS_inputBuffer)
{
// Serial.println("they match");
respflag = 1;
}
else
{
// Serial.println("they dont match");
respflag = 0;
}
return respflag;
} Could be something like: /*
* Compares given string and CS input buffer.
* @param input Whatever this argument represents
* @return Strings match
*/
boolean CS_CheckResponse(String response) {
return response == CS_InputBuffer;
}
|
Some variables might benefit from being declared as volatile. The Arduino documentation explains why. Check variables involved in |
Started refactoring in libaries in branch Making Library 50ec7c0 and ran into loads of interdependency problems. Code has too many globals and stuff at the moment. So some refactoring would be needed along with simplification. Focusing on development for now |
I've detected a few things that can be simplified in the Arduino code to make it more readable and/or efficient. I thought I could list some of them in this issue as I run into them, we can then replace them together and hope you keep them in mind when you develop in the future.
The text was updated successfully, but these errors were encountered: