Exemplo n.º 1
0
/**
  * @brief  This function handles RTC Tamper and Time Stamp interrupts requests.
  * @param  None
  * @retval None
  */
void TAMP_STAMP_IRQHandler(void)
{
  if(RTC_GetFlagStatus(RTC_FLAG_TAMP1F) != RESET)
  { 
    /* Tamper 1 detection event occurred */
    /* Check if RTC Backup Data registers are cleared */
    if(IsBackupRegReset() == 0)
    {
      /* OK, RTC Backup Data registers are reset as expected */
      /* Toggle LED2 */
      STM_EVAL_LEDToggle(LED2);
    }
    else
    {
      /* RTC Backup Data registers are not reset */
      /* Toggle LED4 */
      STM_EVAL_LEDToggle(LED4);
    }
    
    /* Clear Tamper 1 pin Event pending flag */
    RTC_ClearFlag(RTC_FLAG_TAMP1F);

    /* Disable Tamper pin 1 */
    RTC_TamperCmd(RTC_Tamper_1, DISABLE);

    /* Enable Tamper pin */
    RTC_TamperCmd(RTC_Tamper_1, ENABLE); 
  }
}
/**
  * @brief  This function handles Tamper interrupt request. 
  * @param  None
  * @retval None
  */
void TAMPER_IRQHandler(void)
{
  if(BKP_GetITStatus() != RESET)
  { /* Tamper detection event occured */

    /* Check if Backup registers are cleared */
    if(IsBackupRegReset() == 0)
    {/* OK, Backup registers are reset as expected */

      /* Turn on LED3 */
      STM_EVAL_LEDOn(LED3);
    }
    else
    {/* Backup registers are not reset */
      /* Turn on LED4 */
      STM_EVAL_LEDOn(LED4);
    }

    /* Clear Tamper pin interrupt pending bit */
    BKP_ClearITPendingBit();

    /* Clear Tamper pin Event(TE) pending flag */
    BKP_ClearFlag();
  }
}
Exemplo n.º 3
0
/**
 * @brief  This function handles Tamper interrupt request.
 * @param  None
 * @retval None
 */
void TAMPER_STAMP_IRQHandler(void) {
	if (RTC_GetFlagStatus(RTC_FLAG_TAMP1F) != RESET) {
		/* Tamper 1 detection event occurred */
		/* Check if RTC Backup Data registers are cleared */
		if (IsBackupRegReset() == 0) {
			/* OK, RTC Backup Data registers are reset as expected */
			/* Turn on GREEN and BLUE */
			GPIO_SetBits(GPIOB, LD_GREEN_GPIO_PIN | LD_BLUE_GPIO_PIN);
		} else {
			/* RTC Backup Data registers are not reset */
			/* Turn off GREEN and BLUE */
			GPIO_ResetBits(GPIOB, LD_GREEN_GPIO_PIN | LD_BLUE_GPIO_PIN);
		}

		/* Clear Tamper 1 pin Event(TAMP1F) pending flag */
		RTC_ClearFlag(RTC_FLAG_TAMP1F);

		/* Disable Tamper pin 1 */
		RTC_TamperCmd(RTC_Tamper_1, DISABLE);

		/* Enable Tamper pin */
		RTC_TamperCmd(RTC_Tamper_1, ENABLE);
	}
}