TSCH: fix signedness in adaptive timesync
This commit is contained in:
parent
03d511c2be
commit
b57009e564
@ -86,8 +86,8 @@ timesync_entry_add(int32_t val, uint32_t time_delta)
|
|||||||
static void
|
static void
|
||||||
timesync_learn_drift_ticks(uint32_t time_delta_asn, int32_t drift_ticks)
|
timesync_learn_drift_ticks(uint32_t time_delta_asn, int32_t drift_ticks)
|
||||||
{
|
{
|
||||||
/* should fit in 32-bit unsigned integer */
|
/* should fit in a 32-bit integer */
|
||||||
uint32_t time_delta_ticks = time_delta_asn * tsch_timing[tsch_ts_timeslot_length];
|
int32_t time_delta_ticks = time_delta_asn * tsch_timing[tsch_ts_timeslot_length];
|
||||||
int32_t real_drift_ticks = drift_ticks + compensated_ticks;
|
int32_t real_drift_ticks = drift_ticks + compensated_ticks;
|
||||||
int32_t last_drift_ppm = (int32_t)((int64_t)real_drift_ticks * TSCH_DRIFT_UNIT / time_delta_ticks);
|
int32_t last_drift_ppm = (int32_t)((int64_t)real_drift_ticks * TSCH_DRIFT_UNIT / time_delta_ticks);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user