diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/clock.c | 12 | ||||
-rw-r--r-- | src/clock.h | 2 | ||||
-rw-r--r-- | src/main.c | 1 |
3 files changed, 7 insertions, 8 deletions
diff --git a/src/clock.c b/src/clock.c index 5603693..328ad52 100644 --- a/src/clock.c +++ b/src/clock.c @@ -44,18 +44,18 @@ enum clock_registers { TRACECONFIG = 0x55c, }; -static bool init_hfclk() { +static int init_hfclk() { /* We just assert that the source clock is running with the CPU internal clock * as source */ u32 hfclk_status = READ_CLK_REG(HFCLKSTAT); - int clk_src = hfclk_status & 0x1; - bool clk_running = (hfclk_status >> 16) & 0x1; + u32 clk_src = hfclk_status & 0x1; + u32 clk_running = (hfclk_status >> 16) & 0x1; return (clk_src == HFINT) && clk_running; } -static bool init_lfclk() { - bool clk_started = false; +static int init_lfclk() { + int clk_started = 0; enum lfclk_src src = LFRC; /* LFCLK use the LFRC clock by default, so it should be ready @@ -74,6 +74,6 @@ static bool init_lfclk() { return src == LFRC; } -bool init_clock() { +int init_clock() { return init_hfclk() && init_lfclk(); } diff --git a/src/clock.h b/src/clock.h index 30cfb44..8c5d1f0 100644 --- a/src/clock.h +++ b/src/clock.h @@ -5,6 +5,6 @@ * Init the nrf52832 CLOCK device and ensure that clock sources are correctly * selected. */ -bool init_clock(); +int init_clock(); #endif @@ -1,6 +1,5 @@ #include "clock.h" -[[noreturn]] void main() { init_clock(); |