RTC_EverySecondHandler not run

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hi all,

   

 

   

I tired to blinking a led from RTC_EverySecondHandler() routine but not work.

   

This condition is not true and the RTC_EverySecondHandler() is not runing:

   

 

   
        
  1.      
           if       (0u != RTC_IS_BIT_SET       (RTC_intervalCfgMask, RTC_INTERVAL_SEC_MASK       )       )     
  2.     
  3.      
                    {     
  4.     
  5.      
                  RTC_EverySecondHandler       (       );     
  6.     
  7.      
                    }     
  8.    
   

My initialize code is:

   
        
  1. void LED_Toogle()
  2.     
  3. {
  4.     
  5.     LED_Write(!LED_Read());
  6.     
  7. }
  8.     
  9.  
  10.     
  11. int main()
  12.     
  13. {
  14.     
  15.     /* Place your initialization/startup code here (e.g. MyInst_Start()) */
  16.     
  17.     RTC_Start();
  18.     
  19.     CyGlobalIntEnable; /* Uncomment this line to enable global interrupts. */
  20.     
  21.    
  22.     
  23.    
  24.     
  25.     for(;;)
  26.     
  27.     {
  28.     
  29.         /* Place your application code here. */
  30.     
  31.     }
  32.     
  33. }
  34.    
   

Any idea?

   

Best Regards:

   

Niko

0 Likes
3 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

You need to call RTC_WriteIntervalMask() with RTC_INTERVAL_SEC_MASK as parameter to get the one-second stub called.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Thank you very much Bob!

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Niko, you are always welcome!

   

 

   

Bob

0 Likes