Skip to content

Commit 68237b7

Browse files
treewide: align to nrfx_rtc returning errno
NRFX RTC driver now returns errno values. Signed-off-by: Michał Stasiak <[email protected]>
1 parent 427c7dc commit 68237b7

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

applications/nrf5340_audio/src/modules/audio_sync_timer.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ static void rtc_isr_handler(nrfx_rtc_int_type_t int_type)
170170
*/
171171
static int audio_sync_timer_init(void)
172172
{
173-
nrfx_err_t ret;
173+
int ret;
174174
nrfx_dppi_t dppi = NRFX_DPPI_INSTANCE(0);
175175

176176
ret = nrfx_timer_init(&audio_sync_hf_timer_instance, &cfg, unused_timer_isr_handler);
@@ -180,7 +180,7 @@ static int audio_sync_timer_init(void)
180180
}
181181

182182
ret = nrfx_rtc_init(&audio_sync_lf_timer_instance, &rtc_cfg, rtc_isr_handler);
183-
if (ret - NRFX_ERROR_BASE_NUM) {
183+
if (ret != 0) {
184184
LOG_ERR("nrfx rtc init error: %d", ret);
185185
return -ENODEV;
186186
}

samples/bluetooth/conn_time_sync/src/controller_time_nrf52.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ static int rtc_config(void)
5757
const nrfx_rtc_config_t rtc_cfg = NRFX_RTC_DEFAULT_CONFIG;
5858

5959
ret = nrfx_rtc_init(&app_rtc_instance, &rtc_cfg, rtc_isr_handler);
60-
if (ret != NRFX_SUCCESS) {
61-
printk("Failed initializing RTC (ret: %d)\n", ret - NRFX_ERROR_BASE_NUM);
60+
if (ret != 0) {
61+
printk("Failed initializing RTC (ret: %d)\n", ret);
6262
return -ENODEV;
6363
}
6464

@@ -274,7 +274,7 @@ void controller_time_trigger_set(uint64_t timestamp_us)
274274
timer_val = MAX(timer_val, 1);
275275
timer_val = MIN(timer_val, 30);
276276

277-
if (nrfx_rtc_cc_set(&app_rtc_instance, 0, rtc_val, false) != NRFX_SUCCESS) {
277+
if (nrfx_rtc_cc_set(&app_rtc_instance, 0, rtc_val, false) != 0) {
278278
printk("Failed setting trigger\n");
279279
}
280280

samples/bluetooth/conn_time_sync/src/controller_time_nrf53_app.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ static int rtc_config(void)
4848
const nrfx_rtc_config_t rtc_cfg = NRFX_RTC_DEFAULT_CONFIG;
4949

5050
ret = nrfx_rtc_init(&app_rtc_instance, &rtc_cfg, rtc_isr_handler);
51-
if (ret != NRFX_SUCCESS) {
52-
printk("Failed initializing RTC (ret: %d)\n", ret - NRFX_ERROR_BASE_NUM);
51+
if (ret != 0) {
52+
printk("Failed initializing RTC (ret: %d)\n", ret);
5353
return -ENODEV;
5454
}
5555

@@ -248,7 +248,7 @@ void controller_time_trigger_set(uint64_t timestamp_us)
248248
timer_val = MAX(timer_val, 1);
249249
timer_val = MIN(timer_val, 30);
250250

251-
if (nrfx_rtc_cc_set(&app_rtc_instance, 0, rtc_val, false) != NRFX_SUCCESS) {
251+
if (nrfx_rtc_cc_set(&app_rtc_instance, 0, rtc_val, false) != 0) {
252252
printk("Failed setting trigger\n");
253253
}
254254

samples/bluetooth/iso_time_sync/src/controller_time_nrf52.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ static int rtc_config(void)
5757
const nrfx_rtc_config_t rtc_cfg = NRFX_RTC_DEFAULT_CONFIG;
5858

5959
ret = nrfx_rtc_init(&app_rtc_instance, &rtc_cfg, rtc_isr_handler);
60-
if (ret != NRFX_SUCCESS) {
61-
printk("Failed initializing RTC (ret: %d)\n", ret - NRFX_ERROR_BASE_NUM);
60+
if (ret != 0) {
61+
printk("Failed initializing RTC (ret: %d)\n", ret);
6262
return -ENODEV;
6363
}
6464

@@ -274,7 +274,7 @@ void controller_time_trigger_set(uint64_t timestamp_us)
274274
timer_val = MAX(timer_val, 1);
275275
timer_val = MIN(timer_val, 30);
276276

277-
if (nrfx_rtc_cc_set(&app_rtc_instance, 0, rtc_val, false) != NRFX_SUCCESS) {
277+
if (nrfx_rtc_cc_set(&app_rtc_instance, 0, rtc_val, false) != 0) {
278278
printk("Failed setting trigger\n");
279279
}
280280

samples/bluetooth/iso_time_sync/src/controller_time_nrf53_app.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ static int rtc_config(void)
4848
const nrfx_rtc_config_t rtc_cfg = NRFX_RTC_DEFAULT_CONFIG;
4949

5050
ret = nrfx_rtc_init(&app_rtc_instance, &rtc_cfg, rtc_isr_handler);
51-
if (ret != NRFX_SUCCESS) {
52-
printk("Failed initializing RTC (ret: %d)\n", ret - NRFX_ERROR_BASE_NUM);
51+
if (ret != 0) {
52+
printk("Failed initializing RTC (ret: %d)\n", ret);
5353
return -ENODEV;
5454
}
5555

@@ -248,7 +248,7 @@ void controller_time_trigger_set(uint64_t timestamp_us)
248248
timer_val = MAX(timer_val, 1);
249249
timer_val = MIN(timer_val, 30);
250250

251-
if (nrfx_rtc_cc_set(&app_rtc_instance, 0, rtc_val, false) != NRFX_SUCCESS) {
251+
if (nrfx_rtc_cc_set(&app_rtc_instance, 0, rtc_val, false) != 0) {
252252
printk("Failed setting trigger\n");
253253
}
254254

0 commit comments

Comments
 (0)