Add Periphclock enable for L476 products

pull/2611/head
adustm 2016-08-29 11:43:51 +02:00
parent 24832ca365
commit 5069c73e8d
1 changed files with 6 additions and 1 deletions

View File

@ -48,6 +48,12 @@ int mbedtls_hardware_poll( void *data, unsigned char *output, size_t len, size_t
{
int ret;
((void) data);
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct;
/*Select PLLQ output as RNG clock source */
PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_RNG;
PeriphClkInitStruct.RngClockSelection = RCC_RNGCLKSOURCE_PLL;
HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct);
/* RNG Peripheral clock enable */
__HAL_RCC_RNG_CLK_ENABLE();
@ -73,7 +79,6 @@ int mbedtls_hardware_poll( void *data, unsigned char *output, size_t len, size_t
/* RNG Peripheral clock disable - assume we're the only users of RNG */
__HAL_RCC_RNG_CLK_DISABLE();
return( ret );
}