1

I'm having a problem with my enums..

In my header file i declare the enums as followed:

 /********************************************
 *  TYPEDEFINES
 *******************************************/

typedef enum {not_received, received, restart} envelop_status_type;
typedef enum { busy, done, error} ZCD_status_type;


/********************************************
 *  external variables
 *******************************************/

extern volatile envelop_status_type    envelop_status;
extern volatile ZCD_status_type        ZCD_status;

In my c file i declare them as followed:

volatile envelop_status_type envelop_status;
volatile ZCD_status_type ZCD_status;

In all other c files i dont redeclare them, i just use them as followed:

if(envelop_status == received)
    {
        ZCD_status = busy;
    }

The errors are:

  • conflicting types for 'envelop_status_type'
  • conflicting types for 'envelop_status'
  • conflicting types for 'envelop_status'
  • conflicting types for 'ZCD_status_type'
  • conflicting types for 'ZCD_status'
  • conflicting types for 'ZCD_status'
  • redeclaration of enumerator 'busy'
  • redeclaration of enumerator 'done'
  • redeclaration of enumerator 'error'
  • redeclaration of enumerator 'not_received'
  • redeclaration of enumerator 'received'
  • redeclaration of enumerator 'restart'

as environment i'm using LPCXpresso and i'm programming an LPC1343 µController.

4

0 回答 0