Skip to content

Commit 94060f5

Browse files
committed
Compilation fix
1 parent 45b7b0a commit 94060f5

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/protocol/codec/serial.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
// ZettaScale Zenoh Team, <[email protected]>
1313
//
1414

15+
#include <inttypes.h>
1516
#include <stdint.h>
1617
#include <string.h>
1718

@@ -108,7 +109,7 @@ size_t _z_serial_msg_deserialize(const uint8_t *src, size_t src_len, uint8_t *ds
108109

109110
uint32_t computed_crc = _z_crc32(dst, wire_size);
110111
if (received_crc != computed_crc) {
111-
_Z_DEBUG("CRC mismatch. Received: 0x%08lX, Computed: 0x%08lX", received_crc, computed_crc);
112+
_Z_DEBUG("CRC mismatch. Received: 0x%08" PRIu32 ", Computed: 0x%08" PRIu32, received_crc, computed_crc);
112113
return SIZE_MAX;
113114
}
114115

src/system/common/serial.c

+5-4
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@
1212
// ZettaScale Zenoh Team, <[email protected]>
1313
//
1414

15-
#include "zenoh-pico/protocol/definitions/serial.h"
16-
1715
#include <stdint.h>
1816

17+
#if Z_FEATURE_LINK_SERIAL == 1
18+
19+
#include "zenoh-pico/protocol/definitions/serial.h"
1920
#include "zenoh-pico/system/common/platform.h"
2021
#include "zenoh-pico/system/common/serial.h"
2122
#include "zenoh-pico/system/link/serial.h"
@@ -30,8 +31,7 @@ z_result_t _z_connect_serial(const _z_sys_net_socket_t sock) {
3031
uint8_t header = _Z_FLAG_SERIAL_INIT;
3132

3233
_z_send_serial_internal(sock, header, NULL, 0);
33-
uint8_t tmp;
34-
size_t ret = _z_read_serial_internal(sock, &header, &tmp, sizeof(tmp));
34+
size_t ret = _z_read_serial_internal(sock, &header, NULL, 0);
3535
if (ret == SIZE_MAX) {
3636
return _Z_ERR_TRANSPORT_RX_FAILED;
3737
}
@@ -78,3 +78,4 @@ size_t _z_read_exact_serial(const _z_sys_net_socket_t sock, uint8_t *ptr, size_t
7878

7979
return n;
8080
}
81+
#endif // Z_FEATURE_LINK_SERIAL == 1

0 commit comments

Comments
 (0)