Skip to content

Commit aa5b476

Browse files
mib1-nordicjhedberg
authored andcommitted
drivers: timer: nrf_grtc_timer: use a function for cc enable check
Instead of checking register values directly, use a function from nrfx that does this. Signed-off-by: Michał Bainczyk <[email protected]>
1 parent b24f3f3 commit aa5b476

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

drivers/timer/nrf_grtc_timer.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -335,18 +335,13 @@ int z_nrf_grtc_timer_capture_prepare(int32_t chan)
335335

336336
int z_nrf_grtc_timer_capture_read(int32_t chan, uint64_t *captured_time)
337337
{
338-
/* TODO: The implementation should probably go to nrfx_grtc and this
339-
* should be just a wrapper for some nrfx_grtc_syscounter_capture_read.
340-
*/
341-
342338
uint64_t capt_time;
343339
nrfx_err_t result;
344340

345341
IS_CHANNEL_ALLOWED_ASSERT(chan);
346342

347-
/* TODO: Use `nrfy_grtc_sys_counter_enable_check` when available (NRFX-2480) */
348-
if (NRF_GRTC->CC[chan].CCEN == GRTC_CC_CCEN_ACTIVE_Enable) {
349-
/* If the channel is enabled (.CCEN), it means that there was no capture
343+
if (nrfx_grtc_sys_counter_cc_enable_check(chan)) {
344+
/* If the channel is enabled, it means that there was no capture
350345
* triggering event.
351346
*/
352347
return -EBUSY;

0 commit comments

Comments
 (0)