From c7ce6ce772a733306845326672b3805d30c4675c Mon Sep 17 00:00:00 2001 From: Takashi Kojo Date: Thu, 18 Jan 2018 07:00:51 +0900 Subject: [PATCH] fix main.c under projects --- IDE/MDK5-ARM/Projects/CryptBenchmark/main.c | 57 +-------------------- IDE/MDK5-ARM/Projects/CryptTest/main.c | 8 +-- IDE/MDK5-ARM/Projects/EchoClient/main.c | 14 ++--- IDE/MDK5-ARM/Projects/EchoServer/main.c | 2 - IDE/MDK5-ARM/Projects/SimpleClient/main.c | 4 +- IDE/MDK5-ARM/Projects/SimpleServer/main.c | 4 +- 6 files changed, 17 insertions(+), 72 deletions(-) diff --git a/IDE/MDK5-ARM/Projects/CryptBenchmark/main.c b/IDE/MDK5-ARM/Projects/CryptBenchmark/main.c index d24c1f056..25d9e3b5e 100644 --- a/IDE/MDK5-ARM/Projects/CryptBenchmark/main.c +++ b/IDE/MDK5-ARM/Projects/CryptBenchmark/main.c @@ -26,6 +26,8 @@ #include #include "wolfcrypt/test/test.h" + +#include #include /* Dummy definition for test RTC */ @@ -101,61 +103,6 @@ double current_time(int reset) } #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 -extern uint32_t os_time; - -double current_time(int reset) -{ - if(reset) os_time = 0 ; - return (double)os_time /1000.0; -} - -#else - -#include -#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 *----------------------------------------------------------------------------*/ diff --git a/IDE/MDK5-ARM/Projects/CryptTest/main.c b/IDE/MDK5-ARM/Projects/CryptTest/main.c index 6ba384946..3d88e2e7d 100644 --- a/IDE/MDK5-ARM/Projects/CryptTest/main.c +++ b/IDE/MDK5-ARM/Projects/CryptTest/main.c @@ -25,8 +25,6 @@ #include -#include "wolfcrypt/test/test.h" - #include #include @@ -61,8 +59,8 @@ 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){ @@ -132,6 +130,8 @@ static void init_filesystem (void) { /*----------------------------------------------------------------------------- * mian entry *----------------------------------------------------------------------------*/ +void wolfcrypt_test(void *arg) ; + int main() { void * arg = NULL ; diff --git a/IDE/MDK5-ARM/Projects/EchoClient/main.c b/IDE/MDK5-ARM/Projects/EchoClient/main.c index 9536c4390..3fe80f709 100644 --- a/IDE/MDK5-ARM/Projects/EchoClient/main.c +++ b/IDE/MDK5-ARM/Projects/EchoClient/main.c @@ -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 extern uint32_t os_time; @@ -123,8 +123,8 @@ extern uint32_t os_time; double current_time(int reset) { - if(reset) os_time = 0 ; - return (double)os_time /1000.0; + if(reset) os_time = 0 ; + return (double)os_time /1000.0; } #else @@ -133,16 +133,16 @@ double current_time(int reset) #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 */ + 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) ; + if(reset) DWT->CYCCNT = 0 ; + return ((double)DWT->CYCCNT/SystemCoreClock) ; } #endif diff --git a/IDE/MDK5-ARM/Projects/EchoServer/main.c b/IDE/MDK5-ARM/Projects/EchoServer/main.c index b1e4e266d..3138cdd2f 100644 --- a/IDE/MDK5-ARM/Projects/EchoServer/main.c +++ b/IDE/MDK5-ARM/Projects/EchoServer/main.c @@ -29,7 +29,6 @@ #include "rl_net.h" /* Network definitions */ #include -#ifdef WOLFSSL_STM32_CUBEMX #if defined(STM32F7xx) #include "stm32f7xx_hal.h" #elif defined(STM32F4xx) @@ -37,7 +36,6 @@ #elif defined(STM32F2xx) #include "stm32f2xx_hal.h" #endif -#endif //-------- <<< Use Configuration Wizard in Context Menu >>> ----------------- diff --git a/IDE/MDK5-ARM/Projects/SimpleClient/main.c b/IDE/MDK5-ARM/Projects/SimpleClient/main.c index b3b8ee92a..472098717 100644 --- a/IDE/MDK5-ARM/Projects/SimpleClient/main.c +++ b/IDE/MDK5-ARM/Projects/SimpleClient/main.c @@ -156,8 +156,8 @@ double current_time(int reset) #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 */ + 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 ; diff --git a/IDE/MDK5-ARM/Projects/SimpleServer/main.c b/IDE/MDK5-ARM/Projects/SimpleServer/main.c index ce7473df3..7de2c64d8 100644 --- a/IDE/MDK5-ARM/Projects/SimpleServer/main.c +++ b/IDE/MDK5-ARM/Projects/SimpleServer/main.c @@ -151,8 +151,8 @@ double current_time(int reset) #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 */ + 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 ;