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 CCS Technical Support

clearing RBIF flag - input_b optimizes away

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



Joined: 11 Feb 2005
Posts: 6

View user's profile Send private message

clearing RBIF flag - input_b optimizes away
PostPosted: Fri Jan 14, 2011 8:59 am     Reply with quote

I have the following routine. When complied the input_b(); it optimizes away. Without it the RBIF flag is not cleared. I would prefer not to turn optimization off for the whole project. Any suggestions on a simple clean way to prevent it from optimizing away?

Right now I am just assigning it to a global. but I am already low on ram. I suppose I could code a section in assembly, but I am looking for a cleaner way of doing it.






Code:

    //----------------------------------------------------------------------------
    // First stage of keypad routine - key press has been detected, start timer
    // to call keypad scanning (debouce key).
    //----------------------------------------------------------------------------
    #INT_RB
    void keypadIsr (void)
    {
        disable_interrupts(INT_RB);
        input_b();
        keypadTimerStart();
    }
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Jan 14, 2011 9:13 am     Reply with quote

Read this thread:
http://www.ccsinfo.com/forum/viewtopic.php?t=30095
john bougs



Joined: 11 Feb 2005
Posts: 6

View user's profile Send private message

PostPosted: Fri Jan 14, 2011 2:05 pm     Reply with quote

Thanks, I did not find that reference. I am already using that as a alternative but was hoping there was a more elegant solution.
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