Skip to content

Commit 0004357

Browse files
mstasiaknordicmasz-nordic
authored andcommitted
treewide: align to nrfx_rtc returning errno
NRFX RTC driver now returns errno values. Signed-off-by: Michał Stasiak <[email protected]>
1 parent b800653 commit 0004357

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

applications/nrf5340_audio/src/modules/audio_sync_timer.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,17 +170,17 @@ 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
uint32_t eep0, tep0, tep1;
175175

176176
ret = nrfx_timer_init(&audio_sync_hf_timer_instance, &cfg, unused_timer_isr_handler);
177-
if (ret - NRFX_ERROR_BASE_NUM) {
177+
if (ret < 0) {
178178
LOG_ERR("nrfx timer init error: %d", ret);
179179
return -ENODEV;
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

@@ -267,7 +267,7 @@ void controller_time_trigger_set(uint64_t timestamp_us)
267267
timer_val = MAX(timer_val, 1);
268268
timer_val = MIN(timer_val, 30);
269269

270-
if (nrfx_rtc_cc_set(&app_rtc_instance, 0, rtc_val, false) != NRFX_SUCCESS) {
270+
if (nrfx_rtc_cc_set(&app_rtc_instance, 0, rtc_val, false) != 0) {
271271
printk("Failed setting trigger\n");
272272
}
273273

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

@@ -233,7 +233,7 @@ void controller_time_trigger_set(uint64_t timestamp_us)
233233
timer_val = MAX(timer_val, 1);
234234
timer_val = MIN(timer_val, 30);
235235

236-
if (nrfx_rtc_cc_set(&app_rtc_instance, 0, rtc_val, false) != NRFX_SUCCESS) {
236+
if (nrfx_rtc_cc_set(&app_rtc_instance, 0, rtc_val, false) != 0) {
237237
printk("Failed setting trigger\n");
238238
}
239239

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

@@ -266,7 +266,7 @@ void controller_time_trigger_set(uint64_t timestamp_us)
266266
timer_val = MAX(timer_val, 1);
267267
timer_val = MIN(timer_val, 30);
268268

269-
if (nrfx_rtc_cc_set(&app_rtc_instance, 0, rtc_val, false) != NRFX_SUCCESS) {
269+
if (nrfx_rtc_cc_set(&app_rtc_instance, 0, rtc_val, false) != 0) {
270270
printk("Failed setting trigger\n");
271271
}
272272

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

@@ -234,7 +234,7 @@ void controller_time_trigger_set(uint64_t timestamp_us)
234234
timer_val = MAX(timer_val, 1);
235235
timer_val = MIN(timer_val, 30);
236236

237-
if (nrfx_rtc_cc_set(&app_rtc_instance, 0, rtc_val, false) != NRFX_SUCCESS) {
237+
if (nrfx_rtc_cc_set(&app_rtc_instance, 0, rtc_val, false) != 0) {
238238
printk("Failed setting trigger\n");
239239
}
240240

0 commit comments

Comments
 (0)