1 Reply Latest reply on Dec 20, 2016 1:45 AM by anks

    RTC Marco callbacks

    zeng.xuegang

      Hi,

         

      I got a problem about RTC marco callbacks.

         

      When I read the parameters of RTC ,it was working.But I want RTC do something every second.So I fininshed some code according to CAG 6.1.6

         

      code of user code is listed below

         

      TaskHandle_t rtc_task_handle;

         

      void RTC_6813_EverySecondHandler_Callback(void)
      {
          if(rtc_task_handle!=NULL)
          {
              vTaskResume(rtc_task_handle);  
          };
      }

         

      void rtc_test_task(void *pvparameter)
      {
          uint8_t data;
          
          for(;;)
          {
              
              vTaskSuspend(xTaskGetCurrentTaskHandle());
              data=RTC_6813_ReadSecond();
              uart_485_send_block(&data,1);
          };
      }

         

      code of cyapicallbacks.h is listed below

         

      #ifndef CYAPICALLBACKS_H
      #define CYAPICALLBACKS_H
          
          /*Define your macro callbacks here */
          /*For more information, refer to the Macro Callbacks topic in the PSoC Creator Help.*/
          
      #define RTC_6813_EVERY_SECOND_HANDLER_CALLBACK
          
      void RTC_6813_EverySecondHandler_Callback(void);
          
      #endif /* CYAPICALLBACKS_H */  

         

      code of startup is listed below

         

          RTC_6813_Start();
          RTC_6813_EnableInt();
          xTaskCreate(rtc_test_task,"rtctest",configMINIMAL_STACK_SIZE,NULL,1,&rtc_task_handle);

         

      Other tasks of system are fine.The callback function of RTC was not invoked!