Skip to content

Commit fd7c631

Browse files
author
Przemyslaw Bida
committed
nrf_rpc: Fix OS dependencies in NRF RPC.
According to documentation `nrfxlib/nrf_rpc/README.rst` NRF RPC should be OS independent so this commit removes `BIT` and `ARRAY_SIZE` macros that are take directly form zephyr. Signed-off-by: Przemyslaw Bida <[email protected]>
1 parent 3eb9429 commit fd7c631

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

nrf_rpc/include/nrf_rpc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ extern "C" {
3333
#define NRF_RPC_ID_UNKNOWN 0xFF
3434

3535
/** @brief Flag indicating that the group does not block on initialization. */
36-
#define NRF_RPC_FLAGS_WAIT_ON_INIT BIT(0)
36+
#define NRF_RPC_FLAGS_WAIT_ON_INIT 0x01
3737

3838
/** @brief Flag indicating that the peer must initiate group binding. */
39-
#define NRF_RPC_FLAGS_INITIATOR BIT(1)
39+
#define NRF_RPC_FLAGS_INITIATOR 0x02
4040

4141
/** @brief Helper macro for conditional flag initialization. */
4242
#define NRF_RPC_FLAG_COND(_cond, _flag) ((_cond) ? (_flag) : 0UL)

nrf_rpc/nrf_rpc_cbor.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ int nrf_rpc_cbor_cmd_rsp(const struct nrf_rpc_group *group, uint8_t cmd,
6868
&rsp_size);
6969

7070
if (err >= 0) {
71-
zcbor_new_decode_state(ctx->zs, ARRAY_SIZE(ctx->zs),
71+
zcbor_new_decode_state(ctx->zs, ZCBOR_ARRAY_SIZE(ctx->zs),
7272
ctx->out_packet, rsp_size, NRF_RPC_MAX_PARAMETERS, NULL, 0);
7373
}
7474

@@ -176,15 +176,15 @@ void _nrf_rpc_cbor_proxy_handler(const struct nrf_rpc_group *group, const uint8_
176176
struct _nrf_rpc_cbor_decoder *cbor_handler =
177177
(struct _nrf_rpc_cbor_decoder *)handler_data;
178178

179-
zcbor_new_decode_state(ctx.zs, ARRAY_SIZE(ctx.zs), ctx.out_packet, len,
179+
zcbor_new_decode_state(ctx.zs, ZCBOR_ARRAY_SIZE(ctx.zs), ctx.out_packet, len,
180180
NRF_RPC_MAX_PARAMETERS, NULL, 0);
181181

182182
return cbor_handler->handler(group, &ctx, cbor_handler->handler_data);
183183
}
184184

185185
void _nrf_rpc_cbor_prepare(struct nrf_rpc_cbor_ctx *ctx, size_t len)
186186
{
187-
zcbor_new_encode_state(ctx->zs, ARRAY_SIZE(ctx->zs), ctx->out_packet,
187+
zcbor_new_encode_state(ctx->zs, ZCBOR_ARRAY_SIZE(ctx->zs), ctx->out_packet,
188188
len, 0);
189189
ctx->zs->constant_state->stop_on_error = true;
190190
}

0 commit comments

Comments
 (0)