I have problem and hope, that you could help me. I try to make CAN-communication between two dsPIC30F4011. It also works. Now I have to make the Identifier. I have to use the SID and the EID. They are divided into 4 parts. I want to make a bit-declaration and get an error. I made a new header-file
#ifndef IDENTIFIER_H
#define IDENTIFIER_H
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif /* IDENTIFIER_H */
#include <p30F4011.h>
#include "system.h"
#include <p30fxxxx.h>
typedef struct tagCxTXxSIDBITS{
unsigned : 11;
unsigned PRIO4_0 : 5;
}CxTXxPRIOBITS;
extern volatile unsigned int C1TX0PRIO __attribute__((__sfr__));
extern volatile CxTXxPRIOBITS C1TX0PRIObits __attribute__((__sfr__));
extern volatile unsigned int C1TX1PRIO __attribute__((__sfr__));
extern volatile CxTXxPRIOBITS C1TX1PRIObits __attribute__((__sfr__));
extern volatile unsigned int C1TX2PRIO __attribute__((__sfr__));
extern volatile CxTXxPRIOBITS C1TX2PRIObits __attribute__((__sfr__));
In the Code I want to write
...
...
C1TX0PRIO = 0x0000;
...
If I want to build the project I get the error
build/default/production/CAN_function.o(.text+0x66): In function `.LSM19': : undefined reference to `_C1TX0PRIO' make[2]: *** [dist/default/production/blink.X.production.hex] Error 255 make[1]: *** [.build-conf] Error 2 make: *** [.build-impl] Error 2
What did I do wrong? I wrote it like in the p30F4011.h