Jump to content
Sign in to follow this  
rkstowe

Wrong Goto Generated

Recommended Posts

// update the real time clock

void real_time_update (void)

{

// the interupt handler updates real seconds

if (real_seconds > 59) // if we have a minute, update the clock

{

real_seconds = 0;

real_minutes++; // add another minute

 

if (real_minutes > 59)

{

real_minutes = 0;

real_hours++; // add another hour

 

if (real_hours > 24); // ERROR OCCURES HERE

{

real_hours = 0;

real_day++; // add another day

if (real_day > 6) real_day = 0;

}

}

}

} // end of real time update

 

any false if statement should break out of this function. The proper goto statements are generated for all if's except if(real_hours > 24). The if statement codes as though it is always true. The goto the next line is generated. All clock variables are declared global. No error messages are reported. Only warning about bogus delay_us in linker. I relocated the code and have same problem, the clock wont count hours. Days however do work, and all others.

 

SourceBoost 5.9.1, PIC18F252 target, Windows XP.

??? Ron

Share this post


Link to post
Share on other sites

rkstowe,

 

Glad your eye sight is now restored, and that we don't have a new bug :blink:

 

Regards

Dave

Share this post


Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...