mirror of https://github.com/wolfSSL/wolfssl.git
fix main.c under projects
parent
e4093a56f5
commit
c7ce6ce772
|
@ -26,6 +26,8 @@
|
||||||
#include <wolfssl/wolfcrypt/settings.h>
|
#include <wolfssl/wolfcrypt/settings.h>
|
||||||
|
|
||||||
#include "wolfcrypt/test/test.h"
|
#include "wolfcrypt/test/test.h"
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
/* Dummy definition for test RTC */
|
/* Dummy definition for test RTC */
|
||||||
|
@ -101,61 +103,6 @@ double current_time(int reset)
|
||||||
}
|
}
|
||||||
#endif
|
#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){
|
|
||||||
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
|
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------------
|
/*-----------------------------------------------------------------------------
|
||||||
* Initialize a Flash Memory Card
|
* Initialize a Flash Memory Card
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
|
|
|
@ -25,8 +25,6 @@
|
||||||
|
|
||||||
#include <wolfssl/wolfcrypt/settings.h>
|
#include <wolfssl/wolfcrypt/settings.h>
|
||||||
|
|
||||||
#include "wolfcrypt/test/test.h"
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
|
@ -132,6 +130,8 @@ static void init_filesystem (void) {
|
||||||
/*-----------------------------------------------------------------------------
|
/*-----------------------------------------------------------------------------
|
||||||
* mian entry
|
* mian entry
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
|
void wolfcrypt_test(void *arg) ;
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
void * arg = NULL ;
|
void * arg = NULL ;
|
||||||
|
|
|
@ -97,7 +97,7 @@ void net_loop(void const *arg)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
osThreadDef(net_loop, osPriorityNormal, 2, 0);
|
osThreadDef(net_loop, osPriorityLow, 2, 0);
|
||||||
|
|
||||||
#ifdef RTE_CMSIS_RTOS_RTX
|
#ifdef RTE_CMSIS_RTOS_RTX
|
||||||
extern uint32_t os_time;
|
extern uint32_t os_time;
|
||||||
|
@ -123,8 +123,8 @@ extern uint32_t os_time;
|
||||||
|
|
||||||
double current_time(int reset)
|
double current_time(int reset)
|
||||||
{
|
{
|
||||||
if(reset) os_time = 0 ;
|
if(reset) os_time = 0 ;
|
||||||
return (double)os_time /1000.0;
|
return (double)os_time /1000.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
@ -133,16 +133,16 @@ double current_time(int reset)
|
||||||
#define DWT ((DWT_Type *) (0xE0001000UL) )
|
#define DWT ((DWT_Type *) (0xE0001000UL) )
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
uint32_t CTRL; /*!< Offset: 0x000 (R/W) Control Register */
|
uint32_t CTRL; /*!< Offset: 0x000 (R/W) Control Register */
|
||||||
uint32_t CYCCNT; /*!< Offset: 0x004 (R/W) Cycle Count Register */
|
uint32_t CYCCNT; /*!< Offset: 0x004 (R/W) Cycle Count Register */
|
||||||
} DWT_Type;
|
} DWT_Type;
|
||||||
|
|
||||||
extern uint32_t SystemCoreClock ;
|
extern uint32_t SystemCoreClock ;
|
||||||
|
|
||||||
double current_time(int reset)
|
double current_time(int reset)
|
||||||
{
|
{
|
||||||
if(reset) DWT->CYCCNT = 0 ;
|
if(reset) DWT->CYCCNT = 0 ;
|
||||||
return ((double)DWT->CYCCNT/SystemCoreClock) ;
|
return ((double)DWT->CYCCNT/SystemCoreClock) ;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,6 @@
|
||||||
#include "rl_net.h" /* Network definitions */
|
#include "rl_net.h" /* Network definitions */
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
#ifdef WOLFSSL_STM32_CUBEMX
|
|
||||||
#if defined(STM32F7xx)
|
#if defined(STM32F7xx)
|
||||||
#include "stm32f7xx_hal.h"
|
#include "stm32f7xx_hal.h"
|
||||||
#elif defined(STM32F4xx)
|
#elif defined(STM32F4xx)
|
||||||
|
@ -37,7 +36,6 @@
|
||||||
#elif defined(STM32F2xx)
|
#elif defined(STM32F2xx)
|
||||||
#include "stm32f2xx_hal.h"
|
#include "stm32f2xx_hal.h"
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
//-------- <<< Use Configuration Wizard in Context Menu >>> -----------------
|
//-------- <<< Use Configuration Wizard in Context Menu >>> -----------------
|
||||||
|
|
||||||
|
|
|
@ -156,8 +156,8 @@ double current_time(int reset)
|
||||||
#define DWT ((DWT_Type *) (0xE0001000UL) )
|
#define DWT ((DWT_Type *) (0xE0001000UL) )
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
uint32_t CTRL; /*!< Offset: 0x000 (R/W) Control Register */
|
uint32_t CTRL; /*!< Offset: 0x000 (R/W) Control Register */
|
||||||
uint32_t CYCCNT; /*!< Offset: 0x004 (R/W) Cycle Count Register */
|
uint32_t CYCCNT; /*!< Offset: 0x004 (R/W) Cycle Count Register */
|
||||||
} DWT_Type;
|
} DWT_Type;
|
||||||
|
|
||||||
extern uint32_t SystemCoreClock ;
|
extern uint32_t SystemCoreClock ;
|
||||||
|
|
|
@ -151,8 +151,8 @@ double current_time(int reset)
|
||||||
#define DWT ((DWT_Type *) (0xE0001000UL) )
|
#define DWT ((DWT_Type *) (0xE0001000UL) )
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
uint32_t CTRL; /*!< Offset: 0x000 (R/W) Control Register */
|
uint32_t CTRL; /*!< Offset: 0x000 (R/W) Control Register */
|
||||||
uint32_t CYCCNT; /*!< Offset: 0x004 (R/W) Cycle Count Register */
|
uint32_t CYCCNT; /*!< Offset: 0x004 (R/W) Cycle Count Register */
|
||||||
} DWT_Type;
|
} DWT_Type;
|
||||||
|
|
||||||
extern uint32_t SystemCoreClock ;
|
extern uint32_t SystemCoreClock ;
|
||||||
|
|
Loading…
Reference in New Issue