1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

sys/net/coap: cast in non-config define

If we try to set the compile-time config we need to always remember casting, instead, just cast in the places that are not exposed to users
This commit is contained in:
MrKevinWeiss 2024-03-21 10:07:05 +01:00
parent d10fa1b394
commit 575ab684fe
No known key found for this signature in database
GPG Key ID: C26684F1C0767FFF
4 changed files with 5 additions and 5 deletions

View File

@ -563,7 +563,7 @@ typedef enum {
* (@ref CONFIG_COAP_ACK_TIMEOUT_MS * @ref CONFIG_COAP_RANDOM_FACTOR_1000 / 1000). * (@ref CONFIG_COAP_ACK_TIMEOUT_MS * @ref CONFIG_COAP_RANDOM_FACTOR_1000 / 1000).
*/ */
#ifndef CONFIG_COAP_ACK_TIMEOUT_MS #ifndef CONFIG_COAP_ACK_TIMEOUT_MS
#define CONFIG_COAP_ACK_TIMEOUT_MS (2000UL) #define CONFIG_COAP_ACK_TIMEOUT_MS (2000)
#endif #endif
/** /**

View File

@ -50,7 +50,7 @@
#define NO_IMMEDIATE_REPLY (-1) #define NO_IMMEDIATE_REPLY (-1)
/* End of the range to pick a random timeout */ /* End of the range to pick a random timeout */
#define TIMEOUT_RANGE_END (CONFIG_COAP_ACK_TIMEOUT_MS * CONFIG_COAP_RANDOM_FACTOR_1000 / 1000) #define TIMEOUT_RANGE_END ((uint32_t)CONFIG_COAP_ACK_TIMEOUT_MS * CONFIG_COAP_RANDOM_FACTOR_1000 / 1000)
/* Internal functions */ /* Internal functions */
static void *_event_loop(void *arg); static void *_event_loop(void *arg);

View File

@ -189,8 +189,8 @@ ssize_t nanocoap_sock_request_cb(nanocoap_sock_t *sock, coap_pkt_t *pkt,
uint8_t state = STATE_REQUEST_SEND; uint8_t state = STATE_REQUEST_SEND;
/* random timeout, deadline for receive retries */ /* random timeout, deadline for receive retries */
uint32_t timeout = random_uint32_range(CONFIG_COAP_ACK_TIMEOUT_MS * US_PER_MS, uint32_t timeout = random_uint32_range((uint32_t)CONFIG_COAP_ACK_TIMEOUT_MS * US_PER_MS,
CONFIG_COAP_ACK_TIMEOUT_MS * CONFIG_COAP_RANDOM_FACTOR_1000); (uint32_t)CONFIG_COAP_ACK_TIMEOUT_MS * CONFIG_COAP_RANDOM_FACTOR_1000);
uint32_t deadline = _deadline_from_interval(timeout); uint32_t deadline = _deadline_from_interval(timeout);
/* check if we expect a reply */ /* check if we expect a reply */

View File

@ -30,7 +30,7 @@ TEST_ON_CI_BLACKLIST += all
# use small blocksize for test to increase chance for errors # use small blocksize for test to increase chance for errors
CFLAGS += -DCONFIG_NANOCOAP_BLOCKSIZE_DEFAULT=COAP_BLOCKSIZE_16 CFLAGS += -DCONFIG_NANOCOAP_BLOCKSIZE_DEFAULT=COAP_BLOCKSIZE_16
CFLAGS += -DCONFIG_COAP_ACK_TIMEOUT_MS=100UL CFLAGS += -DCONFIG_COAP_ACK_TIMEOUT_MS=100
CFLAGS += -DCONFIG_COAP_MAX_RETRANSMIT=10 CFLAGS += -DCONFIG_COAP_MAX_RETRANSMIT=10
ifneq (,$(filter native native64,$(BOARD))) ifneq (,$(filter native native64,$(BOARD)))