Re: dsp33ch的p33CH512MP508.h file不能更改
|
||||
---|---|---|---|---|
新會員
|
您好
可是像原來 typedef struct tagADMOD0LBITS { uint16_t SIGN0:1; uint16_t :1; uint16_t SIGN1:1; uint16_t :1; uint16_t SIGN2:1; uint16_t :1; uint16_t SIGN3:1; uint16_t :1; uint16_t SIGN4:1; uint16_t :1; uint16_t SIGN5:1; uint16_t :1; uint16_t SIGN6:1; uint16_t :1; uint16_t SIGN7:1; } ADMOD0LBITS; 是沒有定義 uint16_t DIFF0:1; and uint16_t DIFF1:1; 那我要如何加這兩個定義?否則compilier會有redefine的問題! typedef struct tagADMOD0LBITS { uint16_t SIGN0:1; uint16_t DIFF0:1; uint16_t SIGN1:1; uint16_t DIFF1:1; uint16_t SIGN2:1; uint16_t :1; uint16_t SIGN3:1; uint16_t :1; uint16_t SIGN4:1; uint16_t :1; uint16_t SIGN5:1; uint16_t :1; uint16_t SIGN6:1; uint16_t :1; uint16_t SIGN7:1; } ADMOD0LBITS; thanks
發表於: 2020/5/14 11:19
|
|||
|
Re: dsp33ch的p33CH512MP508.h file不能更改
|
||||
---|---|---|---|---|
版主
|
建議不要去修改 CH512MP508.h 的檔案,如有暫存器要加入建議自行建立一個 .h 檔。在程式裡 #include 該 h 檔即可。
發表於: 2020/5/8 12:49
|
|||
|
dsp33ch的p33CH512MP508.h file不能更改
|
||||
---|---|---|---|---|
新會員
|
我要用dspic33ch的AD轉換,發現p33CH512MP508.h裡面有一些SFR並沒有定義,例如我在程式裡自己定義ADCORE0H資料結構,如下
#define ADCORE0H ADCORE0H extern volatile uint16_t ADCORE0H __attribute__((__sfr__)); typedef struct tagADCORE0HBITS { uint16_t ADCS:7; uint16_t :1; uint16_t RES:2; uint16_t EISEL:3; } ADCORE0HBITS; extern volatile ADCORE0HBITS ADCORE0Hbits __attribute__((__sfr__)); /* ADCON1H */ #define _ADCS ADCORE0Hbits.ADCS #define _RES ADCORE0Hbits.RES #define _EISEL ADCORE0Hbits.EISEL #define _ADCORE0H_ADCS_POSITION 0x00000000//BIT POSITION #define _ADCORE0H_ADCS_MASK 0x0000007F//0111111 #define _ADCORE0H_ADCS_LENGTH 0x00000007//7 BIT #define _ADCORE0H_RES_POSITION 0x00000008//7TH BIT #define _ADCORE0H_RES_MASK 0x00000300//0011=8 #define _ADCORE0H_RES_LENGTH 0x00000002//2 BIT #define _ADCORE0H_EISEL_POSITION 0x0000000A #define _ADCORE0H_EISEL_MASK 0x00001C00//1 1100 #define _ADCORE0H_EISEL_LENGTH 0x00000003 但是 ADMOD0Lbits.DIFF0和ADMOD0Lbits.DIFF1在p33CH512MP508.h裡ADMOD0L沒有定義到,而我改好p33CH512MP508.h又存不了,請問我該如何克服這些問題? 另外,p33CH512MP508.inc裡也要一起改? 謝謝
發表於: 2020/5/7 20:07
|
|||
|