- diff --git a/ptxdist/local_src/ecu01-codesys/io_driver/ecu01softcompcap.cpp b/ptxdist/local_src/ecu01-codesys/io_driver/ecu01softcompcap.cpp
- index c5c85b5..78440b7 100644
- --- a/ptxdist/local_src/ecu01-codesys/io_driver/ecu01softcompcap.cpp
- +++ b/ptxdist/local_src/ecu01-codesys/io_driver/ecu01softcompcap.cpp
- @@ -32,6 +32,7 @@
- #include <time.h>
- #include <limits.h>
- #include <stdio.h>
- +#include <string.h>
- /*****************************************************************************/
- /* here: Defines */
- @@ -54,7 +55,10 @@ static inline int diffUSec(struct timespec t1, struct timespec t2)
- // calculate and return the difference of t1 and t2 in microseconds
- diff = USEC_PER_SEC * ((int) t1.tv_sec - (int) t2.tv_sec);
- - diff += ((int) t1.tv_nsec - (int) t2.tv_nsec) / 1000;
- + if (t1.tv_nsec > t2.tv_nsec)
- + diff += ((int) t1.tv_nsec - (int) t2.tv_nsec) / 1000;
- + else
- + diff += (((int) t1.tv_nsec - (int) t2.tv_nsec) / 1000)+USEC_PER_SEC;
- return diff;
- }
- @@ -245,6 +249,7 @@ Ecu01SoftCompCap::Ecu01SoftCompCap():
- {
- int prio = sched_get_priority_max(SCHED_FIFO);
- struct sched_param param;
- + (void)memset(¶m, 0, sizeof(param));
- param.sched_priority = prio;
diffUSec rework, try #667
Posted by Anonymous on Mon 21st Oct 2019 14:44
raw | new post
view followups (newest first): diffUSec rework, try #668 by Anonymous
modification of post by Anonymous (view diff)
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.