This is an automated email from the ASF dual-hosted git repository.

kasjer pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git


The following commit(s) were added to refs/heads/master by this push:
     new 1c9e909ee hw: Adapt return values to nrfx changes
1c9e909ee is described below

commit 1c9e909eee1e90274ea26c73608707efc5775982
Author: Wiktor Kwiatkowski <[email protected]>
AuthorDate: Tue Sep 29 14:10:20 2026 +0200

    hw: Adapt return values to nrfx changes
    
    Since nrfx 4.0.0 release, nordic has changed function return
    types from nrfx_err_t to standard int. This commit adapts to these
    changes.
---
 hw/drivers/adc/adc_nrf51/src/adc_nrf51.c | 8 ++++----
 hw/drivers/i2s/i2s_nrf52/src/i2s_nrf52.c | 4 ++--
 hw/drivers/i2s/i2s_nrfx/src/i2s_nrfx.c   | 2 +-
 hw/mcu/nordic/nrf_common/src/hal_flash.c | 2 +-
 hw/mcu/nordic/nrf_common/src/hal_qspi.c  | 4 ++--
 5 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/hw/drivers/adc/adc_nrf51/src/adc_nrf51.c 
b/hw/drivers/adc/adc_nrf51/src/adc_nrf51.c
index 32ce1ad30..d9e2641d7 100644
--- a/hw/drivers/adc/adc_nrf51/src/adc_nrf51.c
+++ b/hw/drivers/adc/adc_nrf51/src/adc_nrf51.c
@@ -119,7 +119,7 @@ nrf51_adc_open(struct os_dev *odev, uint32_t wait, void 
*arg)
     /* Initialize the device */
     cfg = (nrfx_adc_config_t *)arg;
     rc = nrfx_adc_init(cfg, nrf51_adc_event_handler);
-    if (rc != NRFX_SUCCESS) {
+    if (rc != 0) {
         goto err;
     }
 
@@ -284,7 +284,7 @@ nrf51_adc_set_buffer(struct adc_dev *dev, void *buf1, void 
*buf2,
     buf_len /= sizeof(nrf_adc_value_t);
 
     rc = nrfx_adc_buffer_convert((nrf_adc_value_t *) buf1, buf_len);
-    if (rc != NRFX_SUCCESS) {
+    if (rc != 0) {
         goto err;
     }
 
@@ -302,7 +302,7 @@ nrf51_adc_release_buffer(struct adc_dev *dev, void *buf, 
int buf_len)
     buf_len /= sizeof(nrf_adc_value_t);
 
     rc = nrfx_adc_buffer_convert((nrf_adc_value_t *) buf, buf_len);
-    if (rc != NRFX_SUCCESS) {
+    if (rc != 0) {
         goto err;
     }
 
@@ -334,7 +334,7 @@ nrf51_adc_read_channel(struct adc_dev *dev, uint8_t cnum, 
int *result)
     int rc;
 
     rc = nrfx_adc_sample_convert(nrf_adc_chan, &adc_value);
-    if (rc != NRFX_SUCCESS) {
+    if (rc != 0) {
         rc = OS_EBUSY;
         goto err;
     }
diff --git a/hw/drivers/i2s/i2s_nrf52/src/i2s_nrf52.c 
b/hw/drivers/i2s/i2s_nrf52/src/i2s_nrf52.c
index 449696bfd..7f762edcb 100644
--- a/hw/drivers/i2s/i2s_nrf52/src/i2s_nrf52.c
+++ b/hw/drivers/i2s/i2s_nrf52/src/i2s_nrf52.c
@@ -47,7 +47,7 @@ static void
 nrfx_add_buffer(struct i2s *i2s, struct i2s_sample_buffer *buffer)
 {
     nrfx_i2s_buffers_t nrfx_buffers = {0};
-    nrfx_err_t err;
+    int err;
     uint16_t buffer_size;
 
     assert(i2s != NULL);
@@ -79,7 +79,7 @@ nrfx_add_buffer(struct i2s *i2s, struct i2s_sample_buffer 
*buffer)
         err = nrfx_i2s_next_buffers_set(&nrf52_i2s.inst, &nrfx_buffers);
     }
 
-    assert(err == NRFX_SUCCESS);
+    assert(err == 0);
 }
 
 static void
diff --git a/hw/drivers/i2s/i2s_nrfx/src/i2s_nrfx.c 
b/hw/drivers/i2s/i2s_nrfx/src/i2s_nrfx.c
index a2f4832d4..9e5144f75 100644
--- a/hw/drivers/i2s/i2s_nrfx/src/i2s_nrfx.c
+++ b/hw/drivers/i2s/i2s_nrfx/src/i2s_nrfx.c
@@ -48,7 +48,7 @@ static void
 nrfx_add_buffer(struct i2s *i2s, struct i2s_sample_buffer *buffer)
 {
     nrfx_i2s_buffers_t nrfx_buffers = {0};
-    nrfx_err_t err;
+    int err;
     uint16_t buffer_size;
 
     assert(i2s != NULL);
diff --git a/hw/mcu/nordic/nrf_common/src/hal_flash.c 
b/hw/mcu/nordic/nrf_common/src/hal_flash.c
index 1397e63ad..f0890145c 100644
--- a/hw/mcu/nordic/nrf_common/src/hal_flash.c
+++ b/hw/mcu/nordic/nrf_common/src/hal_flash.c
@@ -94,7 +94,7 @@ nrf_flash_erase_sector(const struct hal_flash *dev, uint32_t 
sector_address)
     rc = nrfx_nvmc_page_erase(sector_address);
     __HAL_ENABLE_INTERRUPTS(sr);
 
-    if (rc != NRFX_SUCCESS) {
+    if (rc != 0) {
         return -1;
     } else {
         return 0;
diff --git a/hw/mcu/nordic/nrf_common/src/hal_qspi.c 
b/hw/mcu/nordic/nrf_common/src/hal_qspi.c
index b5d6dd8e2..91c7f71cd 100644
--- a/hw/mcu/nordic/nrf_common/src/hal_qspi.c
+++ b/hw/mcu/nordic/nrf_common/src/hal_qspi.c
@@ -282,12 +282,12 @@ nrf_qspi_init(const struct hal_flash *dev)
     };
 
     rc = nrfx_qspi_init(&config, NULL, NULL);
-    if (rc != NRFX_SUCCESS) {
+    if (rc != 0) {
         return -1;
     }
 
     rc = nrfx_qspi_activate(true);
-    if (rc != NRFX_SUCCESS) {
+    if (rc != 0) {
         return -1;
     }
 

Reply via email to