How to solve the Enum in struct build error
Not sure what I am doing wrong here in my header file. I have a struct pump_info which has some enums as properties. I get a build error on all 3 on the enums in the struct.
Error
'operation_mode' does not name a type
'operation_mode' does not name a type
'operation_function' does not name a type
#ifndef PUMPINFO_H
#define PUMPINFO_H
#include "time.h"
enum pump_function {
pump_function_off = 0, pump_function_manual = 1, pump_function_automatic = 2
};
enum operation_status {
operation_status_off = 0, operation_status_on = 1
};
enum operation_mode {
operation_mode_standby = 0, operation_mode_duty = 1
};
struct pump_info {
pump_function pump1Function;
operation_status pump1OperationStatus;
operation_mode pump1OperationMode;
float pump1Current;
unsigned long pump1RunHours;
tm pump1LastRunDateTime;
pump_function pump2Function;
operation_status pump2OperationStatus;
operation_mode pump2OperationMode;
float pump2Current;
unsigned long pump2RunHours;
tm pump2LastRunDateTime;
};
#endif // PUMPINFO_H