1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-17 04:52:59 +01:00

Merge pull request #9145 from bergzand/pr/trickle/ms_us_swap

trickle: remove msg_time member from struct
This commit is contained in:
Cenk Gündoğan 2018-05-18 15:00:52 +02:00 committed by GitHub
commit 94541e1802
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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);
}