Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion subsys/mpsl/fem/common/include/mpsl_fem_twi_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/** @brief Structure representing an I2C bus driver for a Front-End Module. */
typedef struct {
const struct device *dev;
nrfx_twim_evt_handler_t nrfx_twim_callback_saved;
nrfx_twim_event_handler_t nrfx_twim_callback_saved;
void *nrfx_twim_callback_ctx_saved;
mpsl_fem_twi_async_xfer_write_cb_t fem_twi_async_xfwr_write_cb;
void *fem_twi_async_xfwr_write_cb_ctx;
Expand Down
30 changes: 12 additions & 18 deletions subsys/mpsl/fem/common/mpsl_fem_twi_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,29 +28,29 @@ static int32_t mpsl_fem_twi_drv_impl_xfer_write(void *p_instance, uint8_t slave_
}

static inline void mpsl_fem_twi_drv_nrfx_twim_callback_replace(mpsl_fem_twi_drv_t *drv,
nrfx_twim_evt_handler_t callback)
nrfx_twim_event_handler_t callback)
{
const struct i2c_nrfx_twim_common_config *config = drv->dev->config;
nrfx_err_t err;
int err;

nrfx_twim_callback_get(&config->twim, &drv->nrfx_twim_callback_saved,
nrfx_twim_callback_get(config->twim, &drv->nrfx_twim_callback_saved,
&drv->nrfx_twim_callback_ctx_saved);

err = nrfx_twim_callback_set(&config->twim, callback, drv);
err = nrfx_twim_callback_set(config->twim, callback, drv);

__ASSERT_NO_MSG(err == NRFX_SUCCESS);
__ASSERT_NO_MSG(err >= 0);
(void)err;
}

static inline void mpsl_fem_twi_drv_nrfx_twim_callback_restore(mpsl_fem_twi_drv_t *drv)
{
const struct i2c_nrfx_twim_common_config *config = drv->dev->config;
nrfx_err_t err;
int err;

err = nrfx_twim_callback_set(&config->twim, drv->nrfx_twim_callback_saved,
err = nrfx_twim_callback_set(config->twim, drv->nrfx_twim_callback_saved,
drv->nrfx_twim_callback_ctx_saved);

__ASSERT_NO_MSG(err == NRFX_SUCCESS);
__ASSERT_NO_MSG(err >= 0);
(void)err;
}

Expand Down Expand Up @@ -91,26 +91,20 @@ static int32_t mpsl_fem_twi_drv_impl_xfer_write_async(void *p_instance, uint8_t
.p_primary_buf = (uint8_t *)p_data,
.primary_length = data_length,
};
nrfx_err_t err;
int32_t ret = 0;
int err;

drv->fem_twi_async_xfwr_write_cb = p_callback;
drv->fem_twi_async_xfwr_write_cb_ctx = p_context;

mpsl_fem_twi_drv_nrfx_twim_callback_replace(drv, mpsl_fem_twi_drv_nrfx_twim_evt_handler);

err = nrfx_twim_xfer(&config->twim, &cur_xfer, 0);
err = nrfx_twim_xfer(config->twim, &cur_xfer, 0);

if (err != NRFX_SUCCESS) {
if (err < 0) {
mpsl_fem_twi_drv_nrfx_twim_callback_restore(drv);
if (err == NRFX_ERROR_BUSY) {
ret = -EBUSY;
} else {
ret = -EIO;
}
}

return ret;
return err;
}

static uint32_t mpsl_fem_twi_drv_frequency_hz_get(mpsl_fem_twi_drv_t *drv)
Expand Down
4 changes: 2 additions & 2 deletions west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ manifest:
# https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/guides/modules.html
- name: zephyr
repo-path: sdk-zephyr
revision: 079d80388a6240f572442ce7021f1aab31a56139
revision: pull/3395/head
import:
# In addition to the zephyr repository itself, NCS also
# imports the contents of zephyr/west.yml at the above
Expand Down Expand Up @@ -280,7 +280,7 @@ manifest:
path: nrfx
groups:
- nrfx
revision: 7ed74ac12ab94f561af820da8fb7089a0323e6de
revision: pull/984/head

# West-related configuration for the nrf repository.
self:
Expand Down
Loading