AnsweredAssumed Answered

Code not compiled with CW5.7 and HCS08GT32

Question asked by Vianney Colombat on Oct 9, 2007
Latest reply on Oct 11, 2007 by Jiri Peroutik
Good morning,

I am using CodeWarrior V5.7 to compile some code for the HCs08GT32 microcontroller.
The problem I have is the next :
I have some C code,

Code:
#if EY_FAMILY || AP_FAMILY if ( MASS_ERASE_EN )   fl_mass_erase();#endif  INF_LOOP:  {  STOP_FLTIM();           /* stop rx timeout timer */      fl_data.fl_str.length = 0xFF-3;      chks = 0;  byte_cnt = 0;  RESET_SCI_RX_FLAGS();  /* reset of SCI rx flag */

and because the result waited does not work I looked the LST file,

Code:
  546:  #if EY_FAMILY || AP_FAMILY  547:   if ( MASS_ERASE_EN )  548:     fl_mass_erase();  549:  #endif  550:    551:    INF_LOOP:  552:    {  553:    STOP_FLTIM();        /* stop rx timeout timer */  554:    555:        fl_data.fl_str.length = 0xFF-3;  0004 6efc01   [4]             MOV   #-4,fl_data:1  556:      chks = 0;  0007 95       [2]             TSX     0008 6f01     [5]             CLR   1,X  557:    byte_cnt = 0;  000a 7f       [4]             CLR   ,X  558:    559:    RESET_SCI_RX_FLAGS();  /* reset of SCI rx flag */  000b 450004   [3]             LDHX  @SCIR:4  000e f6       [3]             LDA   ,X  000f e603     [3]             LDA   3,X  0011 e602     [3]             LDA   2,X  0013 2007     [3]             BRA   L1C ;abs = 001c

 as you can see, the "STOP_FLTIM" macro do not have the corresponding ASM code.

Has someone already seen this behavior of CW ? What can I do to avoid that ?



Below, you can find the code of the macro "STOP_FLTIM" :

Code:
#define STOP_FLTIM() \   STOP_TIM(FLTIM); /* stop and reset FLTIM timer */ \   RESET_TIM(FLTIM); \         RESET_TOVF(FLTIM); /* reset FLTIM flag */ \ #define _STOP_TIM(t)          t##SC &=  ~(CLKSB|CLKSA); #define STOP_TIM(f)           STOP_TIM_a(f##_timer) #define STOP_TIM_a(t)         _STOP_TIM(t) #define _RESET_TIM(t)         t##CNTL = 0; #define RESET_TIM(f)          RESET_TIM_a(f##_timer) #define RESET_TIM_a(t)        _RESET_TIM(t)#define _RESET_TOVF(t)        {READ_REG(t##SC);t##SC&=~TOF;}#define RESET_TOVF(f)         RESET_TOVF_a(f##_timer)#define RESET_TOVF_a(t)       _RESET_TOVF(t)

 Below, you can find the macro preprocessed :

Code:
( * ( ( volatile ZByte * ) ( 0x30 ) ) ) &= ~ ( 0x10 | 0x08 );;( * ( ( volatile ZByte * ) ( 0x32 ) ) ) = 0 ;; { ( ( * ( ( volatile ZByte * ) ( 0x30 ) ) ) ) ; ( * ( ( volatile ZByte * ) ( 0x30 ) ) ) &= ~ 0x80 ; };;

 

Outcomes