/* Timeout calculation function. This function calculates any timeout related to WWDG with given prescaler and system clock.  */
static uint32_t TimeoutCalculation(uint32_t timevalue)
/* Timeout calculation function. This function calculates any timeout related to WWDG with given prescaler and system clock.  */
static uint32_t TimeoutCalculation(uint32_t timevalue)
{
  uint32_t timeoutvalue = 0;
  uint32_t pclk1 = 0;
  uint32_t wdgtb = 0;
  pclk1 = HAL_RCC_GetPCLK1Freq();
  wdgtb = (1 << ((WwdgHandle.Init.Prescaler) >> 7));
  timeoutvalue = ((4096 * wdgtb * timevalue) / (pclk1 / 1000));
  return timeoutvalue;
}