Open raquelalegre opened 9 years ago
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 attachInterrupt
calls in Stim.ino
and CS_Pmark_Test.ino
.
Started refactoring in libaries in branch Making Library 50ec7c0d0b8c9581a3646ebd373b35f74946393d 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.