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:
parent
d10fa1b394
commit
575ab684fe
@ -563,7 +563,7 @@ typedef enum {
|
||||
* (@ref CONFIG_COAP_ACK_TIMEOUT_MS * @ref CONFIG_COAP_RANDOM_FACTOR_1000 / 1000).
|
||||
*/
|
||||
#ifndef CONFIG_COAP_ACK_TIMEOUT_MS
|
||||
#define CONFIG_COAP_ACK_TIMEOUT_MS (2000UL)
|
||||
#define CONFIG_COAP_ACK_TIMEOUT_MS (2000)
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -50,7 +50,7 @@
|
||||
#define NO_IMMEDIATE_REPLY (-1)
|
||||
|
||||
/* 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 */
|
||||
static void *_event_loop(void *arg);
|
||||
|
@ -189,8 +189,8 @@ ssize_t nanocoap_sock_request_cb(nanocoap_sock_t *sock, coap_pkt_t *pkt,
|
||||
uint8_t state = STATE_REQUEST_SEND;
|
||||
|
||||
/* random timeout, deadline for receive retries */
|
||||
uint32_t timeout = random_uint32_range(CONFIG_COAP_ACK_TIMEOUT_MS * US_PER_MS,
|
||||
CONFIG_COAP_ACK_TIMEOUT_MS * CONFIG_COAP_RANDOM_FACTOR_1000);
|
||||
uint32_t timeout = random_uint32_range((uint32_t)CONFIG_COAP_ACK_TIMEOUT_MS * US_PER_MS,
|
||||
(uint32_t)CONFIG_COAP_ACK_TIMEOUT_MS * CONFIG_COAP_RANDOM_FACTOR_1000);
|
||||
uint32_t deadline = _deadline_from_interval(timeout);
|
||||
|
||||
/* check if we expect a reply */
|
||||
|
@ -30,7 +30,7 @@ TEST_ON_CI_BLACKLIST += all
|
||||
|
||||
# use small blocksize for test to increase chance for errors
|
||||
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
|
||||
|
||||
ifneq (,$(filter native native64,$(BOARD)))
|
||||
|
Loading…
Reference in New Issue
Block a user