Beim Compilieren erhalte ich folgende Fehlermeldung: Error: 'SMBvariables' undeclared (first use in this function) kann mir Jemand weiterhelfen? Hier der Sourcecode:
1 | -----------------------------------------------------------------------
|
2 | SMBSlave.h |
3 | -----------------------------------------------------------------------
|
4 | .....
|
5 | #define SMBvariables SV.SMBvar
|
6 | #define SMBvar_int SV.SMBint
|
7 | |
8 | #ifndef MODULE_SMBUS
|
9 | union { volatile unsigned char SMBvar[29][2]; volatile unsigned int SMBint[29]; } SV; |
10 | |
11 | char str_MfrName[] PROGMEM = "\014Atmel Norway"; //__flash char |
12 | char str_DeviceName[] PROGMEM = "\005SB100"; |
13 | char str_DeviceChem[] PROGMEM = "\004LION"; |
14 | char str_MfrData[] PROGMEM = "\013MfrDataArea"; |
15 | #else
|
16 | extern union { volatile unsigned char SMBvar[29][2]; volatile unsigned int SMBint[29]; } SV; |
17 | #endif
|
18 | .......
|
1 | -----------------------------------------------------------------------
|
2 | communication.c |
3 | -----------------------------------------------------------------------
|
4 | #include <avr/interrupt.h> |
5 | #include "SMBSlave.h" |
6 | .....
|
7 | |
8 | ISR(TWIBUSCD_vect) |
9 | {
|
10 | //clear bits per sbdat110, 4.4.2
|
11 | SMBvariables[SMBV_BattMode][hibyte] &= ~(0xE3); |
12 | |
13 | if(TWBCSR & (1<<TWBCIP)) //this int was caused by bus DISCONNECT event. |
14 | {
|
15 | TWBCSR &= ~(1<<TWBCIP); |
16 | //SH ChangePowerMode(POWERMODE_IDLE,0);
|
17 | }
|
18 | else //this int occurred due to a bus CONNECT event. |
19 | {
|
20 | TWBCSR |= (1<<TWBCIP); |
21 | //SH ChangePowerMode(POWERMODE_ACTIVE,0);
|
22 | }
|
23 | }
|
24 | ..
|
25 | /////////////////////////////////////////////////////////////////////
|