mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-24 11:54:49 +00:00
Autodetect STM32 in mg_millis()
This commit is contained in:
1 parent
013993abae
commit
2a174b0d3b
2 files changed
+10
-4
No files matched your search
@@ -180,6 +180,10 @@ uint64_t mg_millis(void) {
|
||||
return ((uint64_t) ts.tv_sec * 1000 + (uint64_t) ts.tv_nsec / 1000000);
|
||||
#elif defined(ARDUINO)
|
||||
return (uint64_t) millis();
|
||||
#elif defined(__STM32H5xx_HAL_H) || defined(__STM32H7xx_HAL_H) || \
|
||||
defined(__STM32F7xx_HAL_H) || defined(__STM32F4xx_HAL_H) || \
|
||||
defined(__STM32F2xx_HAL_H) || defined(__STM32F1xx_HAL_H)
|
||||
return (uint64_t) HAL_GetTick(); // Using STM32 HAL
|
||||
#else
|
||||
return (uint64_t) (time(NULL) * 1000);
|
||||
#endif
|
||||
|
||||
Reference in new issue
Block a user