Skip to content

Instantly share code, notes, and snippets.

@ayjayt
Created October 13, 2018 18:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ayjayt/120281b87200a594c0a9027d370fafef to your computer and use it in GitHub Desktop.
Save ayjayt/120281b87200a594c0a9027d370fafef to your computer and use it in GitHub Desktop.
#define OFF 0
#define START 1
#define PROCESS_ONE 2
#define PROCESS_TWO 3
#define END 4
uint8_t state;
if (state == OFF) // etc
/ *************************
* OR
*************************** /
enum state_t {
OFF = 0,
START,
PROCESS_ONE,
PROCESS_TWO,
END
};
state_t state;
if (state == OFF) // etc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment