| 101 | void (*PlatformSpecificRestoreJumpBuffer)(void) = C2000RestoreJumpBuffer; |
| 102 | |
| 103 | static long C2000TimeInMillis() |
| 104 | { |
| 105 | /* The TI c2000 platform does not have Posix support and thus lacks struct timespec. |
| 106 | * Also, clock() always returns 0 in the simulator. Hence we work with struct tm.tm_hour |
| 107 | * This has two consequences: |
| 108 | * (1) We need to sum up the part in order to get an "elapsed since" time value, |
| 109 | * rather than just using tm_sec. |
| 110 | * (2) There is a possibility of overflow, since we stop at the hour |
| 111 | * (3) Resolution is 1 s, even though we return ms. |
| 112 | */ |
| 113 | time_t t = time((time_t*)0); |
| 114 | struct tm * ptm = gmtime(&t); |
| 115 | long result = (long) |
| 116 | ((ptm->tm_sec + ptm->tm_min * (time_t)60 + ptm->tm_hour * (time_t)3600) * (time_t)1000); |
| 117 | return result; |
| 118 | } |
| 119 | |
| 120 | static const char* TimeStringImplementation() |
| 121 | { |
nothing calls this directly
no outgoing calls
no test coverage detected