Skip to content

Commit fe7b6f1

Browse files
dgarskedanielinux
authored andcommitted
Add missing TimeNowInMilliseconds for FreeRTOS
1 parent c349001 commit fe7b6f1

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

src/tls13.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1948,7 +1948,12 @@ int DeriveTls13Keys(WOLFSSL* ssl, int secret, int side, int store)
19481948
t = k_uptime_get(); /* returns current uptime in milliseconds */
19491949
return (word32)t;
19501950
}
1951-
1951+
#elif defined(FREERTOS)
1952+
word32 TimeNowInMilliseconds(void)
1953+
{
1954+
return (word32)((uint64_t)(xTaskGetTickCount() * 1000) /
1955+
configTICK_RATE_HZ);
1956+
}
19521957
#else
19531958
/* The time in milliseconds.
19541959
* Used for tickets to represent difference between when first seen and when
@@ -2241,7 +2246,12 @@ int DeriveTls13Keys(WOLFSSL* ssl, int secret, int side, int store)
22412246
t = k_uptime_get(); /* returns current uptime in milliseconds */
22422247
return (sword64)t;
22432248
}
2244-
2249+
#elif defined(FREERTOS)
2250+
sword64 TimeNowInMilliseconds(void)
2251+
{
2252+
return (sword64)((uint64_t)(xTaskGetTickCount() * 1000) /
2253+
configTICK_RATE_HZ);
2254+
}
22452255
#else
22462256
/* The time in milliseconds.
22472257
* Used for tickets to represent difference between when first seen and when

0 commit comments

Comments
 (0)