2015-08-26 02:54 AM
hi !! i like as the question , i can see the Hal_GetTick() will return the variable uWick that is uni32_t type and increment one unit when the systick interrupt happen .and will it overflow when the uint32 type data to to the maximun value ??? and will it be return 0 ??
the best thank #old-school-basics2015-08-28 08:25 AM
Yes, the systick value will reset after overrrun (~49 days@1000 tick/s). the vallue will reset back to 0. If your application will run mor than 49 days without resseting AND you remember tick count to make measurements then you nee to take care about it.
2015-08-28 08:45 AM
If you just do the math properly the wrapping won't matter, assuming your delays are less than 49 days.
uint32_t start, current, delta;delta = (current - start); // The math works and accounts for the wrapDON'T USE end = (start + x) type constructs.