aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVictor Mignot <victor@vmignot.fr>2025-07-29 08:39:33 +0200
committerVictor Mignot <victor@vmignot.fr>2025-08-08 09:01:29 +0200
commitc4314b35efe14fd0c1c57c8c3577431b380e323e (patch)
treea903b06c5043214ba2ac4ead7143cfc2f31f0cb1 /src
parent6d10f951d5c5ebae58f7c24df1066a479b68d5fa (diff)
downloadnanji-c4314b35efe14fd0c1c57c8c3577431b380e323e.tar.gz
use c99 instead of c23
Diffstat (limited to 'src')
-rw-r--r--src/clock.c12
-rw-r--r--src/clock.h2
-rw-r--r--src/main.c1
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
diff --git a/src/main.c b/src/main.c
index 02c20f8..aab0723 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1,6 +1,5 @@
#include "clock.h"
-[[noreturn]]
void main() {
init_clock();