Open alfersi opened 7 months ago
IWDG_Enable in ch32v00x_iwdg.c of the peripheral library has a bug while checking if the bit LSYRDY of the RSTSCKR register is set by waiting endlessly for it to be set with a condition impossible to meet:
while ((RCC->RSTSCKR)|(0x2)!= SET);
The correct way should be:
while ((RCC->RSTSCKR & RCC_LSIRDY)!= RCC_LSIRDY);
I also noticed this bug when the compiler pointed me to it after I turned on -Wall
-Wall
IWDG_Enable in ch32v00x_iwdg.c of the peripheral library has a bug while checking if the bit LSYRDY of the RSTSCKR register is set by waiting endlessly for it to be set with a condition impossible to meet:
while ((RCC->RSTSCKR)|(0x2)!= SET);
The correct way should be:
while ((RCC->RSTSCKR & RCC_LSIRDY)!= RCC_LSIRDY);