Ok, so how I understand #include works is by looking up what you are including and complies that and replaces it where the include is. however, when I assume this, my program doesn't compile and it gives __ is undefined all over the place.
for example when in my main.c will have something like
#include "tim.h"
#include "tim_cfg.h"
#include "tim_api.h"
tim.h contains some typesdefs like
typedef enum
{
RATE_DIV1 = 0X0,
RATE_DIV2 = 0X1,
RATE_DIV3 = 0X2,
RATE_DIV4 = 0X3,
RATE_DIV5 = 0X4,
RATE_DIV6 = 0X5,
RATE_DIV7 = 0X6,
RATE_DIV8 = 0X7,
RATE_DIV9 = 0X8
} BaseRate_T;
typedef unsigned char byte;
tim_cfg.h contains register locations and basic structs
typedef struct
{
byte TimerSize;
byte InterruptLevel;
} TIMInfo_T;
and tim_api.h contains the function prototypes of the tim functions
So, the problem is why do I get errors
identifier "byte" is undefined
When it the first thing I include?
tim.halso itself includetim_api.hat a point before where thetypedefis? If it's not too long, post the entiretim.h, or at least the portion up to and includingTIMInfo_T.typedef, thestruct, and a main program (to printsizeof(TIMInfo_T), say), it works fine, so something else is going on. Doestim_api.hhave code in it? That sometimes has weird effects.extern voidsin it