I have defined the following enum:
typedef enum {
F105 = 0x00,
F164 = 0x10,
F193 = 0x20,
F226 = 0x30,
F227 = 0x40
}BOARD_TYPE;
To make the code readable, I would like to use the enum name when using one of its members. Like this:
void do_work(uint8_t board_type) {
if (board_type == BOARD_TYPE.F164) {
// Do stuff...
}
}
Now, this doesn't compile. I get an error message "Expected expression before 'BOARD_TYPE'".
So what would be the proper way of using a enum member while also referring to the enum name to increase code readability?