AnsweredAssumed Answered

Global variable not allocated

Question asked by crouse shaw on Aug 14, 2013
Latest reply on Aug 14, 2013 by ZhangJennie

Hi all :

 

I'm use CW5.9  for MC9S08AC32 before , and I creat a file(.h file) for store for globe variable for main.c & MCUinit.c include use,

 

when debugging (use DEMOAC for programming), the Data window can view globe variable directly and refresh period , very convenient,

 

for ROM size not enough (move to MC9S08AC48) , I use CW6.3 ,

 

but same code in CW6.3 , the global variable show in Data window "not allocated" , could any one can give an advise?

 

the globe variable default as below :

//---------------------------------------------------------

#ifndef VARIABLE_H

#define VARIABLE_H

 

#include "mc9s08ac48.h"

 

#define unsigned8 unsigned char

#define unsigned16 unsigned int

//----- variables ---------------------------------------

extern unsigned8    TestFan_Cnt;    

extern unsigned8    Relay_Off_60_Cnt;

extern unsigned8    Relay_Off_20_Cnt;

extern unsigned16   Sleep_30min;

 

typedef union {

  byte Byte;

  struct {

    byte OD_Err            :1;                                  

    byte OD_Restraint    :1;                  

    byte                         :1;                             

    byte                         :1;                          

    byte                         :1;                        

    byte                         :1;                             

    byte                         :1;                               

    byte                         :1;                         

  } Bits;

} ODEC;

extern volatile ODEC       _OD_Err_Code_;

#define OD_EC_Code     _OD_Err_Code_.Byte

#define OD_Err               _OD_Err_Code_.Bits.OD_Err

#define OD_Restraint      _OD_Err_Code_.Bits.OD_Restraint

#endif

 

//------------------------------------------------------------------------------------------------

 

I also use

 

1. "volatile" for prevent optimise.

 

2. Edit -> Standard settings -> Compiler for HC08 -> Smart Sliders -> Debug Comlexity ->  low.

 

, it's still not working ...

 

訊息由此人編輯:crouse shaw

Attachments

Outcomes