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

trickle: remove msg_time member from struct

The msg_time member is only locally used and set before read. It can
be removed as the state kept by the member is not used.
This commit is contained in:
Koen Zandberg 2018-05-16 15:30:13 +02:00
parent af829e2da4
commit aa84c3e6b8
No known key found for this signature in database
GPG Key ID: 0895A893E6D2985B
2 changed files with 2 additions and 3 deletions

View File

@ -58,7 +58,6 @@ typedef struct {
trickle_callback_t callback; /**< callback function and parameter that
trickle calls after each interval */
msg_t msg; /**< the msg_t to use for intervals */
uint64_t msg_time; /**< interval in ms */
xtimer_t msg_timer; /**< xtimer to send a msg_t to the target
thread for a new interval */
} trickle_t;

View File

@ -51,8 +51,8 @@ void trickle_interval(trickle_t *trickle)
/* old_interval == trickle->I / 2 */
trickle->t = random_uint32_range(old_interval, trickle->I);
trickle->msg_time = (trickle->t + diff) * MS_PER_SEC;
xtimer_set_msg64(&trickle->msg_timer, trickle->msg_time, &trickle->msg,
uint64_t msg_time = (trickle->t + diff) * US_PER_MS;
xtimer_set_msg64(&trickle->msg_timer, msg_time, &trickle->msg,
trickle->pid);
}