Go Down

Topic: delay() issue - where to best report Due bugs? (Read 704 times) previous topic - next topic


Has anyone noticed the glaring bug in Due delay() function?
Code: [Select]

void delay( uint32_t ms )
    uint32_t end = GetTickCount() + ms;
    while (GetTickCount() < end)

[ Namely failure to deal with wrap-around ]

Suggested fix:
Code: [Select]

void delay (uint32_t ms)
  if (ms == 0)
    return ;
  uint32_t start = GetTickCount () ;
  do { yield () ; } while (GetTickCount() - start < ms) ;
[ I won't respond to messages, use the forum please ]


I believe you will get a warm reception at https://github.com/arduino/Arduino/issues?page=1&state=open, make sure you check the open issues to avoid a duplicate bug report.


Thanks - if they had simply copied the Wait() function from libsam's timetick.c and
added the call to yield() it would have been fine!
[ I won't respond to messages, use the forum please ]

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131