CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

int8 Rom problem CCS > 4.130

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Torello



Joined: 29 Sep 2006
Posts: 117

View user's profile Send private message

int8 Rom problem CCS > 4.130
PostPosted: Thu Sep 20, 2012 7:46 am     Reply with quote

Hi,

In version upto 4.130 below snipped worked perfectly:
Code:

//=== Global varaiables assignment =============================================
int8 ROM BootMark[2]= {0x00,0x00};           //clear this Program Flash int16 at Firmware program to detect a firmware program

void bos_McuRstGetSource() {
  //-- Check Mcu source of (re)boot
  bos.McuRstMode=0;                                  // load "undefined"
  if (RI&POR) bos.McuRstMode|= MclrRst;              // Mclr reset caused Mcu reboot
  else
    if (!RI) bos.McuRstMode|= SoftRst;               // Reset intstruction cause Mcu reboot
    else
      if (!POR) bos.McuRstMode |= PwrRst;            // PowerOn -OR- Flash reprogram caused Mcu reboot
  //-- Check if firmware has been reprogrammed
  if (read_program_eeprom(&BootMark)!=0xEBEB) {      // T:Firmware is flashed! (firmware Reprograms 0 in rom int16 'bootmark')
    bos.McuRstMode |= FwRst;                         // flag firmware (re)program reboot
  }
}


Now in version 4.136, I get an error on the &BootMark reference "expecting an identifier"

Any thoughts why?
_________________
Regards, Edwin. PCWHD v5.114
Torello



Joined: 29 Sep 2006
Posts: 117

View user's profile Send private message

PostPosted: Thu Sep 20, 2012 9:01 am     Reply with quote

--
_________________
Regards, Edwin. PCWHD v5.114


Last edited by Torello on Thu Sep 20, 2012 9:05 am; edited 1 time in total
RF_Developer



Joined: 07 Feb 2011
Posts: 839

View user's profile Send private message

PostPosted: Thu Sep 20, 2012 9:03 am     Reply with quote

Because support for program memory pointers, i.e. const and rom, is a recent addition to the compiler and has worked/not worked/has altered syntax on various recent releases of the compiler. In other words it worked OK on 4.130, but isn't working on 4.136. That doesn't imply anything about its working, or not in 4.131, 132, 133, 134 or 135 :-(

The support for this function has been, to say the least, flakey.

Be that as it may, have you checked out restart_cause(), which does much the same as your code? Indeed it does more.

RF Developer
Torello



Joined: 29 Sep 2006
Posts: 117

View user's profile Send private message

PostPosted: Thu Sep 20, 2012 9:12 am     Reply with quote

I removed the "address off" operator which should not be necessary. Seems to work (still testing).

At reboot I also need to know if the firmware has been reflashed. If so I re-intitialize the eeprom parameters with default values.
restart_cause() doesn't detect a program reflash
_________________
Regards, Edwin. PCWHD v5.114
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group