
De motorcontroller van het TLS2 project.
Revision 5:006b0b8374ea, committed 2016-11-17
- Comitter:
- RichardHoekstra
- Date:
- Thu Nov 17 10:32:45 2016 +0000
- Parent:
- 4:614517a6e2af
- Child:
- 6:c090a1a7e8dd
- Commit message:
- Small comment changes. Minus some profanity
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Thu Nov 17 10:29:58 2016 +0000 +++ b/main.cpp Thu Nov 17 10:32:45 2016 +0000 @@ -64,11 +64,12 @@ } */ +//Join two char values into one integer value int char2_to_int(char* arr, int first_element = 0){ return (arr[first_element]<<8)+arr[first_element+1]; } -//Returns true if it was succesfull at updating +//Returns true if it was succesful at updating bool updateVariables(char* arr){ enum commands_t { SET_MODE = 1, SET_CONSTANT_PRESSURE, SET_CONSTANT_FLOW, SET_CONSTANT_SPEED, SET_MIN, SET_MAX, SET_FREQUENCY, RECEIVE_PRESSURE, RECEIVE_FLOW @@ -207,7 +208,7 @@ buffer_changed = true; break; } - //Do shit depending on the command it received in the first data block + //Update the variables if the buffer has changed. if(buffer_changed == true){ updateVariables(buffer); //Clear the buffer for the next iteration