|
@@ -36,7 +36,7 @@
|
|
|
#if defined(STM32F7xx)
|
|
|
#include "stm32f7xx_hal.h"
|
|
|
#elif defined(STM32F4xx)
|
|
|
-#include "stm32f2xx_hal.h"
|
|
|
+#include "stm32f4xx_hal.h"
|
|
|
#elif defined(STM32F2xx)
|
|
|
#include "stm32f2xx_hal.h"
|
|
|
#endif
|
|
@@ -58,8 +58,63 @@ static void CPU_CACHE_Enable (void) {
|
|
|
extern uint32_t os_time;
|
|
|
static time_t epochTime;
|
|
|
|
|
|
-uint32_t HAL_GetTick(void) {
|
|
|
- return os_time;
|
|
|
+uint32_t HAL_GetTick(void) {
|
|
|
+ return os_time;
|
|
|
+}
|
|
|
+
|
|
|
+time_t time(time_t *t){
|
|
|
+ return epochTime ;
|
|
|
+}
|
|
|
+
|
|
|
+void setTime(time_t t){
|
|
|
+ epochTime = t;
|
|
|
+}
|
|
|
+#endif
|
|
|
+
|
|
|
+#ifdef WOLFSSL_CURRTIME_OSTICK
|
|
|
+
|
|
|
+#include <stdint.h>
|
|
|
+extern uint32_t os_time;
|
|
|
+
|
|
|
+double current_time(int reset)
|
|
|
+{
|
|
|
+ if(reset) os_time = 0 ;
|
|
|
+ return (double)os_time /1000.0;
|
|
|
+}
|
|
|
+
|
|
|
+#else
|
|
|
+
|
|
|
+#include <stdint.h>
|
|
|
+#define DWT ((DWT_Type *) (0xE0001000UL) )
|
|
|
+typedef struct
|
|
|
+{
|
|
|
+ uint32_t CTRL; /*!< Offset: 0x000 (R/W) Control Register */
|
|
|
+ uint32_t CYCCNT; /*!< Offset: 0x004 (R/W) Cycle Count Register */
|
|
|
+} DWT_Type;
|
|
|
+
|
|
|
+extern uint32_t SystemCoreClock ;
|
|
|
+
|
|
|
+double current_time(int reset)
|
|
|
+{
|
|
|
+ if(reset) DWT->CYCCNT = 0 ;
|
|
|
+ return ((double)DWT->CYCCNT/SystemCoreClock) ;
|
|
|
+}
|
|
|
+#endif
|
|
|
+
|
|
|
+static void MPU_Config (void) {
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+static void CPU_CACHE_Enable (void) {
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+#ifdef RTE_CMSIS_RTOS_RTX
|
|
|
+extern uint32_t os_time;
|
|
|
+static time_t epochTime;
|
|
|
+
|
|
|
+uint32_t HAL_GetTick(void) {
|
|
|
+ return os_time;
|
|
|
}
|
|
|
|
|
|
time_t time(time_t *t){
|