From 312db1a301305bc7a1e253405d4deb41d5b3fb2b Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Thu, 14 Jan 2010 19:34:30 +0100 Subject: Fix logic bugs in rcc_wait_for_osc_ready(). Thanks Thomas Otto for the patch! --- lib/rcc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/rcc.c b/lib/rcc.c index 8781562..58ab8b5 100644 --- a/lib/rcc.c +++ b/lib/rcc.c @@ -121,19 +121,19 @@ void rcc_wait_for_osc_ready(osc_t osc) { switch (osc) { case PLL: - while ((RCC_CR & PLLRDY) != 0); + while ((RCC_CR & PLLRDY) == 0); break; case HSE: - while ((RCC_CR & HSERDY) != 0); + while ((RCC_CR & HSERDY) == 0); break; case HSI: - while ((RCC_CR & HSIRDY) != 0); + while ((RCC_CR & HSIRDY) == 0); break; case LSE: - while ((RCC_BDCR & LSERDY) != 0); + while ((RCC_BDCR & LSERDY) == 0); break; case LSI: - while ((RCC_CSR & LSIRDY) != 0); + while ((RCC_CSR & LSIRDY) == 0); break; } } -- cgit v1.2.3