diff --git a/samples/net/cloud/google_iot_mqtt/src/protocol.c b/samples/net/cloud/google_iot_mqtt/src/protocol.c index 180237023f2..e9aa1462583 100644 --- a/samples/net/cloud/google_iot_mqtt/src/protocol.c +++ b/samples/net/cloud/google_iot_mqtt/src/protocol.c @@ -201,7 +201,7 @@ static int wait_for_input(int timeout) return res; } -#define ALIVE_TIME (MSEC_PER_SEC * 60U) +#define ALIVE_TIME K_SECONDS(60) static struct mqtt_utf8 password = { .utf8 = token diff --git a/samples/net/cloud/mqtt_azure/src/main.c b/samples/net/cloud/mqtt_azure/src/main.c index 1e7a48a4adb..09f7a51746a 100644 --- a/samples/net/cloud/mqtt_azure/src/main.c +++ b/samples/net/cloud/mqtt_azure/src/main.c @@ -342,7 +342,7 @@ static void publish_message(void) end: k_delayed_work_submit(&pub_message, - MSEC_PER_SEC * timeout_for_publish()); + K_SECONDS(timeout_for_publish())); k_sem_take(&publish_msg, K_FOREVER); } } @@ -470,7 +470,7 @@ static void check_network_connection(struct k_work *work) LOG_INF("waiting for DHCP to acquire addr"); end: - k_delayed_work_submit(&check_network_conn, 3 * MSEC_PER_SEC); + k_delayed_work_submit(&check_network_conn, K_SECONDS(3)); } #endif @@ -493,7 +493,7 @@ static void l4_event_handler(struct net_mgmt_event_callback *cb, if (mgmt_event == NET_EVENT_L4_CONNECTED) { /* Wait for DHCP to be back in BOUND state */ - k_delayed_work_submit(&check_network_conn, 3 * MSEC_PER_SEC); + k_delayed_work_submit(&check_network_conn, K_SECONDS(3)); return; } diff --git a/samples/net/sockets/coap_server/src/coap-server.c b/samples/net/sockets/coap_server/src/coap-server.c index d0845ee8eb8..42f474623e0 100644 --- a/samples/net/sockets/coap_server/src/coap-server.c +++ b/samples/net/sockets/coap_server/src/coap-server.c @@ -995,7 +995,7 @@ static void update_counter(struct k_work *work) coap_resource_notify(resource_to_notify); } - k_delayed_work_submit(&observer_work, MSEC_PER_SEC * 5U); + k_delayed_work_submit(&observer_work, K_SECONDS(5)); } static int create_pending_request(struct coap_packet *response, @@ -1099,7 +1099,7 @@ static int send_notification_packet(const struct sockaddr *addr, } } - k_delayed_work_submit(&observer_work, MSEC_PER_SEC * 5U); + k_delayed_work_submit(&observer_work, K_SECONDS(5)); r = send_coap_reply(&response, addr, addr_len);