From 99e3c574a02fdb779e97186119891fbe46390d72 Mon Sep 17 00:00:00 2001 From: June McEnroe Date: Mon, 9 Apr 2018 01:00:54 -0400 Subject: Replace #define with enum or const where possible --- help.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'help.c') diff --git a/help.c b/help.c index 4415065..d997bde 100644 --- a/help.c +++ b/help.c @@ -46,16 +46,18 @@ static void clientPut(uint8_t color, char cell) { clientMessage(msg); } -#define DELAY (50000) - -#define R (COLOR_RED) -#define G (COLOR_GREEN) -#define Y (COLOR_YELLOW) -#define B (COLOR_BLUE) -#define M (COLOR_MAGENTA) -#define C (COLOR_CYAN) -#define W (COLOR_WHITE) -#define I (COLOR_BRIGHT | COLOR_WHITE) +static const useconds_t DELAY = 50000; + +enum { + R = COLOR_RED, + G = COLOR_GREEN, + Y = COLOR_YELLOW, + B = COLOR_BLUE, + M = COLOR_MAGENTA, + C = COLOR_CYAN, + W = COLOR_WHITE, + I = COLOR_BRIGHT | COLOR_WHITE, +}; static void h(void) { clientMove(-1, 0); usleep(DELAY); } static void j(void) { clientMove( 0, 1); usleep(DELAY); } -- cgit 1.4.1