Skip to content

Commit b9cad9d

Browse files
michalpasztamobicaSeppo Takalo
authored andcommitted
Remove floating point literals from Thread code
1 parent 423a48f commit b9cad9d

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

source/6LoWPAN/Thread/thread_bootstrap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -955,7 +955,7 @@ static void thread_interface_bootsrap_mode_init(protocol_interface_info_entry_t
955955
cur->thread_info->thread_device_mode = THREAD_DEVICE_MODE_SLEEPY_END_DEVICE;
956956
//SET Sleepy Host To RX on Idle mode for bootsrap
957957
nwk_thread_host_control(cur, NET_HOST_RX_ON_IDLE, 0);
958-
cur->thread_info->childUpdateReqTimer = 0.8 * cur->thread_info->host_link_timeout;
958+
cur->thread_info->childUpdateReqTimer = 8 * cur->thread_info->host_link_timeout / 10;
959959
} else {
960960
tr_debug("Set End node Mode");
961961
cur->thread_info->thread_device_mode = THREAD_DEVICE_MODE_END_DEVICE;

source/6LoWPAN/Thread/thread_common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ void thread_key_guard_timer_calculate(protocol_interface_info_entry_t *cur, link
381381
}
382382

383383
cur->thread_info->masterSecretMaterial.keyRotation = key_rotation * 3600; // setting value is hours converting to seconds
384-
cur->thread_info->masterSecretMaterial.keySwitchGuardTimer = is_init ? 0 : (key_rotation * 3600 * 0.93);
384+
cur->thread_info->masterSecretMaterial.keySwitchGuardTimer = is_init ? 0 : (key_rotation * 3600 * 93 / 100);
385385
}
386386

387387
void thread_key_guard_timer_reset(protocol_interface_info_entry_t *cur)

source/6LoWPAN/Thread/thread_mle_message_handler.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -892,7 +892,7 @@ static void thread_parse_child_update_response(protocol_interface_info_entry_t *
892892

893893
if (cur->thread_info->thread_device_mode == THREAD_DEVICE_MODE_SLEEPY_END_DEVICE) {
894894
if (cur->thread_info->childUpdateReqTimer < 1) {
895-
cur->thread_info->childUpdateReqTimer = 0.8 * timeout;
895+
cur->thread_info->childUpdateReqTimer = 8 * timeout / 10;
896896
}
897897
}
898898
//This process is ready

0 commit comments

Comments
 (0)