Fix the adjusting of the time when there is a rollover (#1788)

This commit is contained in:
Philip Gladstone 2017-02-09 15:53:12 -05:00 committed by Marcel Stör
parent a21c3d3b11
commit 00bc9403fe
1 changed files with 2 additions and 1 deletions

View File

@ -43,7 +43,8 @@ static void gpio_intr_callback_task (task_param_t param, uint8 priority)
// Now must be >= then . Add the missing bits
if (then > (now & 0xffffff)) {
then += 0x1000000;
// Now must have rolled over since the interrupt -- back it down
now -= 0x1000000;
}
then = (then + (now & 0x7f000000)) & 0x7fffffff;