replaced TRNG frequency check macro with osalDbgAssert

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@14611 27425a3e-05d8-49a3-a47f-9c15f0e5edd8
This commit is contained in:
vrepetenko 2021-07-23 18:26:26 +00:00
parent 614920363e
commit 5b35ee9ab8
2 changed files with 6 additions and 8 deletions

View File

@ -82,6 +82,12 @@ void trng_lld_init(void) {
*/
void trng_lld_start(TRNGDriver *trngp) {
#if !defined(STM32_DISABLE_RNG_CLOCK_CHECK)
osalDbgAssert(((STM32_RNGCLK >= 47000000) && (STM32_RNGCLK <= 49000000)) ||
((STM32_RNGCLK >= 3500000) && (STM32_RNGCLK <= 4500000)),
"invalid RNG frequency");
#endif
/* There is no real configuration but setting up a valid pointer anyway.*/
if (trngp->config == NULL) {
trngp->config = &default_cfg;

View File

@ -85,14 +85,6 @@
#error "STM32_RNGCLK not defined in this HAL"
#endif
#if ((STM32_RNGCLK < 47000000) || (STM32_RNGCLK > 49000000)) && \
((STM32_RNGCLK < 3500000) || (STM32_RNGCLK > 4500000))
#if !defined(STM32_DISABLE_RNG_CLOCK_CHECK)
#error "STM32_RNGCLK is not within a tested clock range"
#error "define STM32_DISABLE_RNG_CLOCK_CHECK to override this check"
#endif
#endif
/*===========================================================================*/
/* Driver data structures and types. */
/*===========================================================================*/