Some calls to `coap_build_hdr()` were done with the target buffer for
the header and the source buffer for the token overlapping:
They reuse the buffer that held the request to assemble the response in.
We cannot use `memcpy()` in this case to copy the token into the target
buffer, as source and destination would (fully) overlap.
This commit makes reusing the request buffer for the response a special
case: `memcpy()` is only used to copy the token if source and
destination address of the token differ.
An alternative fix would have been to use `memmove()` unconditionally.
But `memmove()` does not make any assumption about the layout of target
and source buffer, while we know that the token either will already be
at the right position (when reusing the request buffer for the response)
or be in a non-overlapping buffer (when generating a fresh token). This
approach is more efficient than `memmove()`.
This adds a clang-format configuration based on the Linux Kernel
configuration and modified to better match RIOT's coding convention.
Co-authored-by: mguetschow <mikolai.guetschow@tu-dresden.de>
This patch replaces the package supplied logging macros with RIOT's. It
also removes the requirement that DEVELHELP be defined to enable
logging. Instead, logging can be enabled/dissabled via the log level.
This patch replaces the package supplied logging macros with RIOT's. It
also removes the requirement that DEVELHELP be defined to enable
logging. Instead, logging can be enabled/dissabled via the log level.
The patch also replaceses the package's trace macro with RIOT's DEBUG
macro.
This adds enough to do compile testing for gcoap_forward_proxy.
A proper test would still be needed, though.
This still already exposed compilation issues.
Now that model.h is in the repo, it no longer is a build dependency.
This allows compilation of the test without having emlearn installed,
which is useful e.g. for build testing.
The board is compatible with Arduino UNO and Arduino MEGA shields and
has an ISP connector, so this adds the corresponding features.
This adds the Arduino I/O-mapping for the ISP SPI and provides the
corresponding feature.
It appears that the SPI on D11/D12/D13 cannot be provided by a SERCOM,
this is under clarification at [1]. For now, no I/O mapping for that
SPI bus is provided.
[1]: https://forums.adafruit.com/viewtopic.php?t=214093
newlib (nano) does not support 64 bit types (neither in stdio nor with
corresponding `PRI*64` macros). With GCC 13.2.1 (as shipped in Ubuntu
24.04.1 LTS), this triggers the following compilation error (even with
`ENABLE_DEBUG == 0`):
sys/matstat/matstat.c:57:21: error: expected ')' before 'PRIu64'
57 | DEBUG("Var: (%" PRIu64 " / (%" PRId32 " - 1)) = %" PRIu64 "\n",
| ^~~~~~
This fixes the issue by falling back to printing 32 bit values when
the `PRIu64` macro is not defined. A `!trunc` is appended when the
64 bit exceeds the range of [0:UINT32_MAX].