Skip to content

Commit 12ab277

Browse files
Raanecarlescufi
authored andcommitted
sample: esb: Delay esb_init until hf clock has started.
Add a loop which blocks the clock initialization until the clock is actually started. Without this blocking the esb initialization would fail on certain devices. Signed-off-by: Rune Holmgren <[email protected]>
1 parent 6a47fa4 commit 12ab277

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

samples/esb/prx/src/main.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,13 @@ int clocks_start(void)
109109
return err;
110110
}
111111

112+
/* Block until clock is started.
113+
*/
114+
while (clock_control_get_status(clk, CLOCK_CONTROL_NRF_SUBSYS_HF) !=
115+
CLOCK_CONTROL_STATUS_ON) {
116+
117+
}
118+
112119
LOG_DBG("HF clock started");
113120
return 0;
114121
}

samples/esb/ptx/src/main.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,13 @@ int clocks_start(void)
7272
return err;
7373
}
7474

75+
/* Block until clock is started.
76+
*/
77+
while (clock_control_get_status(clk, CLOCK_CONTROL_NRF_SUBSYS_HF) !=
78+
CLOCK_CONTROL_STATUS_ON) {
79+
80+
}
81+
7582
LOG_DBG("HF clock started");
7683
return 0;
7784
}

0 commit comments

Comments
 (0)