diff --git a/Lab_1/TestEncoderAAR.c b/Lab_1/TestEncoderAAR.c index c2608a7..1c3fa59 100644 --- a/Lab_1/TestEncoderAAR.c +++ b/Lab_1/TestEncoderAAR.c @@ -19,7 +19,7 @@ char receivedChars[numChars]="00"; // an array to store the received data void initialiseEncoderStateMachine(); void updateEncoderStateMachine(); -enum states get_state(); +enum states get_current_state(); int main() { @@ -54,7 +54,7 @@ int main() // Could be implemented as a C macro, which would be faster // but I've forgotten how to define C macros -enum states get_state() +enum states get_current_state() { /* If A is 0 and B is 0, system is in State 1 If A is 1 and B is 0, system is in State 2 @@ -72,13 +72,13 @@ enum states get_state() void initialiseEncoderStateMachine() { - state = get_state(); + state = get_current_state(); } void updateEncoderStateMachine() { - enum states new_state = get_state(); // get new state, don't update state yet so states can be compared + enum states new_state = get_current_state(); // get new state, don't update state yet so states can be compared switch (state) {