//------------------------------------------------------Experimental
typedef struct tagPCA21125_00H{
union
{
UCH8 DATA[0x0F];
struct {
PCA21125_00H_CTRL1_t CTRL1; //Byte 0
PCA21125_01H_CTRL2_t CTRL2;
PCA21125_02H_tSec_t tSec;
PCA21125_03H_tMin_t tMin; // t = time, a = alarm
PCA21125_04H_tHr_t tHr;
PCA21125_05H_tDay_t tDay;
UCH8 tWeekday;
PCA21125_07H_tMonth_t tMonth;
PCA21125_08H_tYear_t tYear;
UCH8 aSec;
UCH8 aMin;
UCH8 aHr;
UCH8 aWeekday;
PCA21125_0DH_CLKOUT_t CLKOUT;
PCA21125_0EH_Timer_t TimerCTRL;
UCH8 TimerData;
};
};
}PCA21125_t;
extern volatile PCA21125_t PCA21125;
//------------------------------------------------------Control 1
typedef struct tagPCA21125_00H{
union
{
UCH8 Byte;
struct {
UCH8 :1; //Bit0
UCH8 :1;
UCH8 h12_24:1; // Must be 0 (alway)
UCH8 POR_OVRD:1;
UCH8 :1;
UCH8 STOP:1; // Must be 0 (alway)
UCH8 :1;
UCH8 EXT_TEST:1;
};
};
}PCA21125_00H_CTRL1_t;
//extern volatile PCA21125_00H_CTRL1_t PCA21125_CTRL1;
上記のコードを実装しようとしましたが、MPLABX XC8 コンパイラはタグ (PCA21125_00H_CTRL1_t CTRL1) を気に入らなかったため、何が間違っているのでしょうか?この問題を解決するにはどうすればよいですか?
提供されたコンパイラエラー
0_Main/../5_PCA21125/PIC18_PCA21125.h:29: warning: missing basic type; int assumed
0_Main/../5_PCA21125/PIC18_PCA21125.h:29: error: ";" expected
0_Main/../5_PCA21125/PIC18_PCA21125.h:29: warning: missing basic type; int assumed
0_Main/../5_PCA21125/PIC18_PCA21125.h:30: warning: missing basic type; int assumed
0_Main/../5_PCA21125/PIC18_PCA21125.h:30: error: ";" expected
0_Main/../5_PCA21125/PIC18_PCA21125.h:30: warning: missing basic type; int assumed
などなど