Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

err_code_t not used consistently in all driver header files

Not really a problem, just a suggestion for improvement.

Using nRF5_SDK_14.2.0_17b948a

We have this definition:

./nrf-sdk/components/libraries/util/sdk_errors.h:157:typedef uint32_t ret_code_t;

But for instance in nrf-sdk/components/drivers_nrf/ppi/nrf_drv_ppi.h we have:

uint32_t nrf_drv_ppi_channels_remove_from_group(uint32_t channel_mask,
    nrf_ppi_channel_group_t group);

i.e. the returned value is declared as uint32_t, rather than ret_code_t.

For consistency, even if both types are equivalent, it would be good if the declaration would use ret_code_t.

Am I wrong ?

Related