本文整理汇总了C++中RTC_ClearITPendingBit函数的典型用法代码示例。如果您正苦于以下问题:C++ RTC_ClearITPendingBit函数的具体用法?C++ RTC_ClearITPendingBit怎么用?C++ RTC_ClearITPendingBit使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RTC_ClearITPendingBit函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RTC_IRQHandler
/*******************************************************************************
* 函 数 名:
* 功 能:
* 参 数:
* 返 回:
*******************************************************************************/
void RTC_IRQHandler(void)
{
//秒钟中断
if( RTC_GetITStatus(RTC_IT_SEC) != RESET )
{
if( sec_irq_handle != NULL)
{
sec_irq_handle();
}
RTC_ClearITPendingBit(RTC_IT_SEC);
}
//闹钟中断
if(RTC_GetITStatus(RTC_IT_ALR) != RESET)
{
if(alrf_irq_hanle != NULL)
{
alrf_irq_hanle();
}
RTC_ClearITPendingBit(RTC_IT_ALR);
}
//溢出中断
if(RTC_GetITStatus(RTC_IT_OW) != RESET)
{
if(ow_irq_hanle != NULL)
{
ow_irq_hanle();
}
RTC_ClearITPendingBit(RTC_IT_OW);
}
RTC_WaitForLastTask();
}
示例2: RTC_IRQHandler
/*
************************************************************
* 函数名称: RTC_IRQHandler
*
* 函数功能: RTC一般功能中断
*
* 入口参数: 无
*
* 返回参数: 无
*
* 说明:
************************************************************
*/
void RTC_IRQHandler(void)
{
//秒中断
if(RTC_GetITStatus(RTC_IT_SEC))
{
RTC_ClearITPendingBit(RTC_IT_SEC); //清秒中断
//........do something
}
//溢出中断
if(RTC_GetITStatus(RTC_IT_OW))
{
RTC_ClearITPendingBit(RTC_IT_OW); //清溢出中断
//........do something
}
//闹钟中断
if(RTC_GetITStatus(RTC_IT_ALR))
{
RTC_ClearITPendingBit(RTC_IT_ALR); //清闹钟中断
//........do something
}
RTC_WaitForLastTask(); //等待操作完成
}
示例3: RTC_WKUP_IRQHandler
/*
* RTC wakeup interrupt handler.
*/
void RTC_WKUP_IRQHandler(void)
{
#if POSCFG_FEATURE_TICKLESS != 0
if (RTC_GetITStatus(RTC_IT_WUT) != RESET) {
/*
* Stop wakeup counter and ensure
* system wakes up from sleep.
*/
RTC_WakeUpCmd(DISABLE);
RTC_ClearITPendingBit(RTC_IT_WUT);
EXTI_ClearITPendingBit(EXTI_Line22);
SCB->SCR &= ~SCB_SCR_SLEEPONEXIT_Msk;
}
#else
c_pos_intEnter();
if (RTC_GetITStatus(RTC_IT_WUT) != RESET) {
RTC_ClearITPendingBit(RTC_IT_WUT);
EXTI_ClearITPendingBit(EXTI_Line22);
c_pos_timerInterrupt();
}
c_pos_intExitQuick();
#endif
}
示例4: RTC_IRQHandler
void RTC_IRQHandler(void)
{
if (RTC_GetITStatus(RTC_IT_SEC) != RESET)
{
/* Clear the RTC Second interrupt */
RTC_ClearITPendingBit(RTC_IT_SEC);
/* Enable time update */
/* Wait until last write operation on RTC registers has finished */
RTC_WaitForLastTask();
Time_Display();
}
if (RTC_GetITStatus(RTC_IT_ALR) != RESET)
{
/* Clear the RTC Second interrupt */
RTC_ClearITPendingBit(RTC_IT_ALR);
/* Enable time update */
/* Wait until last write operation on RTC registers has finished */
RTC_WaitForLastTask();
printf(" RTC WAKEUP\r\n");
}
}
示例5: RTC_IRQHandler
void RTC_IRQHandler(void) {
#ifdef STM32F1
RTC_ClearITPendingBit(RTC_IT_ALR);
#else
RTC_ClearITPendingBit(RTC_IT_ALRA);
#endif
}
示例6: rtcIrqHandler
void rtcIrqHandler(void)
{
if (RTC_GetITStatus(RTC_IT_SEC) != RESET) {
RTC_ClearITPendingBit(RTC_FLAG_SEC);
#ifdef PRECISION_IN_MS
if (RTC_GetCounter() / 999 >= 1) {
RTC_WaitForLastTask();
RTC_SetCounter(0);
RTC_WaitForLastTask();
++seconds;
}
#endif
}
/* ignore overflow */
//if (RTC_GetITStatus(RTC_IT_OW) != RESET) {
// RTC_ClearITPendingBit(RTC_FLAG_OW);
//}
#ifndef PRECISION_IN_MS
if (RTC_GetITStatus(RTC_IT_ALR) != RESET) {
RTC_ClearITPendingBit(RTC_FLAG_ALR);
if (alarm > 0 && alarm != NULL) {
alarmProc();
}
}
#else
if (alarm > 0 && alarm == seconds
&& alarm != NULL) {
alarmProc();
}
#endif
}
示例7: RTC_IRQHandler
//RTC时钟中断
//每秒触发一次
//extern u16 tcnt;
void RTC_IRQHandler(void)
{
if (RTC_GetITStatus(RTC_IT_SEC) != RESET)//秒钟中断
{
RTC_Get();//更新时间
}
if(RTC_GetITStatus(RTC_IT_ALR)!= RESET)//闹钟中断
{
RTC_ClearITPendingBit(RTC_IT_ALR); //清闹钟中断
}
RTC_ClearITPendingBit(RTC_IT_SEC|RTC_IT_OW); //清闹钟中断
RTC_WaitForLastTask();
}
示例8: RTC_Alarm_IRQHandler
void RTC_Alarm_IRQHandler(void)
{
if(RTC_GetITStatus(RTC_IT_ALRA) != RESET){
RTC_ClearITPendingBit(RTC_IT_ALRA);
EXTI_ClearITPendingBit(EXTI_Line17);
}
}
示例9: RTC_IRQHandler
/*******************************************************************************
* Function Name : RTC_IRQHandler
* Description : This function handles RTC global interrupt request.
* Input : None
* Output : None
* Return : None
*******************************************************************************/
void RTC_IRQHandler(void)
{
volatile unsigned long int stanRTC;
static unsigned char stanRTCTekst[17] = {"0\0"};
unsigned long int godziny, minuty, sekundy;
if (RTC_GetITStatus(RTC_IT_SEC) != RESET)
{
// Czekaj na zakonczenie ewentualnych operacji zapisu do rejestrów RTC
RTC_WaitForLastTask();
// Wyczysc flage od przerwania RTC
RTC_ClearITPendingBit(RTC_IT_SEC);
// Zmiana stanu wyprowadzenia PB15 co 1s
GPIO_WriteBit(GPIOB, GPIO_Pin_15, (BitAction)(1 - GPIO_ReadOutputDataBit(GPIOB, GPIO_Pin_15)));
stanRTC=RTC_GetCounter();
//sprintf((char *)stanRTCTekst,"%16i\0",stanRTC);
//LCD_WriteTextXY(stanRTCTekst,0,1);
sekundy=stanRTC%60; //liczba sekund od ostatniej pelnej minuty
minuty=(long int)(stanRTC)/60; //dzielenie calkowite, "usuniecie" sekund, czas pracy w samych minutach
godziny=(long int)(minuty)/60; //dzielenie calkowite, "usuniecie" minut, czas pracy w samych godzinach
minuty=minuty%60; //liczba minut od ostatniej pelnej godziny
sprintf((char *)stanRTCTekst,"%3i:%02i:%02i\0",godziny,minuty,sekundy);
LCD_WriteTextXY(stanRTCTekst,7,1);
}
}
示例10: RTCAlarm_IRQHandler
/*******************************************************************************
* Function Name : RTCAlarm_IRQHandler
* Description : This function handles RTC Alarm interrupt request.
* Input : None
* Output : None
* Return : None
*******************************************************************************/
void RTCAlarm_IRQHandler(void)
{
if(RTC_GetITStatus(RTC_IT_ALR) != RESET)
{
SPARK_WLAN_SLEEP = 0;
/* Clear EXTI line17 pending bit */
EXTI_ClearITPendingBit(EXTI_Line17);
/* Check if the Wake-Up flag is set */
if(PWR_GetFlagStatus(PWR_FLAG_WU) != RESET)
{
/* Clear Wake Up flag */
PWR_ClearFlag(PWR_FLAG_WU);
}
/* Wait until last write operation on RTC registers has finished */
RTC_WaitForLastTask();
/* Clear RTC Alarm interrupt pending bit */
RTC_ClearITPendingBit(RTC_IT_ALR);
/* Wait until last write operation on RTC registers has finished */
RTC_WaitForLastTask();
}
}
示例11: RTC_IRQHandler
//RTC时钟中断
//每秒触发一次
//extern u16 tcnt;
void RTC_IRQHandler(void)
{
if (RTC_GetITStatus(RTC_IT_SEC) != RESET)//秒钟中断
{
RTC_Get();//更新时间
}
if(RTC_GetITStatus(RTC_IT_ALR)!= RESET)//闹钟中断
{
RTC_ClearITPendingBit(RTC_IT_ALR); //清闹钟中断
RTC_Get(); //更新时间
printf("Alarm Time:%d-%d-%d %d:%d:%d\n",calendar.w_year,calendar.w_month,calendar.w_date,calendar.hour,calendar.min,calendar.sec);//输出闹铃时间
}
RTC_ClearITPendingBit(RTC_IT_SEC|RTC_IT_OW); //清闹钟中断
RTC_WaitForLastTask();
}
示例12: RTC_IRQHandler
void RTC_IRQHandler(void)
{
/* 判断中断标志位_秒中断 是否被置位 */
if (RTC_GetITStatus(RTC_IT_SEC) != RESET)
{
/* Clear the RTC Second interrupt */
RTC_ClearITPendingBit(RTC_IT_SEC);
/* Toggle GPIO_LED pin 6 each 1s */
//GPIO_WriteBit(GPIO_LED, GPIO_Pin_6, (BitAction)(1 - GPIO_ReadOutputDataBit(GPIO_LED, GPIO_Pin_6)));
/* Enable time update
* TimeDisplay是一个标志位,只有等于1时才让串口发送时 间数据,即让串口一秒发一次时间值 */
TimeDisplay = 1;
/* Wait until last write operation on RTC registers has finished */
RTC_WaitForLastTask();
/* Reset RTC Counter when Time is 23:59:59
* 当时间走到23:59:59秒时RTC计数器中的值清零,0x00015180=23*3600+56*60+59 */
if (RTC_GetCounter() == 0x00015180)
{
RTC_SetCounter(0x0);
/* Wait until last write operation on RTC registers has finished */
RTC_WaitForLastTask();
}
}
}
示例13: RTC_IRQHandler
/*******************************************************************************
* Function Name : RTC_IRQHandler
* Description : This function handles RTC global interrupt request.
* Input : None
* Output : None
* Return : None
*******************************************************************************/
void RTC_IRQHandler(void)
{
if(RTC_GetITStatus(RTC_IT_SEC) != RESET)
{
// /* If counter is equal to 86339: one day was elapsed */
// if((RTC_GetCounter() / 3600 == 23)
// && (((RTC_GetCounter() % 3600) / 60) == 59)
// && (((RTC_GetCounter() % 3600) % 60) == 59)) /* 23*3600 + 59*60 + 59 = 86339 */
// {
// /* Wait until last write operation on RTC registers has finished */
// RTC_WaitForLastTask();
//
// /* Reset counter value */
// RTC_SetCounter(0x0);
//
// /* Wait until last write operation on RTC registers has finished */
// RTC_WaitForLastTask();
//
// /* Increment no_of_days_elapsed variable here */
// }
/* Clear the RTC Second Interrupt pending bit */
RTC_ClearITPendingBit(RTC_IT_SEC);
/* Wait until last write operation on RTC registers has finished */
RTC_WaitForLastTask();
}
}
示例14: p_pos_powerTickResume
void p_pos_powerTickResume()
{
/*
* Make sure that wakeup counter is disabled.
*/
NVIC_DisableIRQ(RTC_WKUP_IRQn);
RTC_WakeUpCmd(DISABLE);
RTC_ClearITPendingBit(RTC_IT_WUT);
EXTI_ClearITPendingBit(EXTI_Line22);
/*
* Do application-specific clock setup after sleep.
*/
portRestoreClocksAfterWakeup();
/*
* Now step the timer with amount of ticks we really slept.
*/
c_pos_timerStep(HZ * (rtcTimeNow() - startTime) / 1000);
/*
* Safe to enable systick now.
*/
SysTick->CTRL |= (SysTick_CTRL_TICKINT_Msk |
SysTick_CTRL_ENABLE_Msk);
}
示例15: RTC_IRQHandler
void RTC_IRQHandler(void)
{
long xHigherPriorityTaskWoken = pdFALSE;
current_rtime.sec += 1;
if (current_rtime.sec >= 60) {
current_rtime.sec -= 60;
current_rtime.min += 1;
if (current_rtime.min >= 60) {
current_rtime.min -= 60;
current_rtime.hour += 1;
if (current_rtime.hour >= 24) {
current_rtime.hour -= 24;
}
}
struct guievent gevnt;
gevnt.evnt = GUI_E_CLOCK;
gevnt.buf = NULL;
gevnt.kpar = 0;
xQueueSendFromISR(toGuiQueue, &gevnt, &xHigherPriorityTaskWoken);
}
/* clear RTC irq pending bit of the 'seconds' irq */
RTC_ClearITPendingBit(RTC_IT_SEC);
/* signal end-of-irq and possible reschedule point */
portEND_SWITCHING_ISR( xHigherPriorityTaskWoken );
}