Browse Source

fix main.c under projects

Takashi Kojo 6 years ago
parent
commit
c7ce6ce772

+ 2 - 55
IDE/MDK5-ARM/Projects/CryptBenchmark/main.c

@@ -26,6 +26,8 @@
 #include <wolfssl/wolfcrypt/settings.h>
 
 #include "wolfcrypt/test/test.h"
+
+#include <stdio.h>
 #include <time.h>
 
 /* 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 <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
  *----------------------------------------------------------------------------*/

+ 4 - 4
IDE/MDK5-ARM/Projects/CryptTest/main.c

@@ -25,8 +25,6 @@
 
 #include <wolfssl/wolfcrypt/settings.h>
 
-#include "wolfcrypt/test/test.h"
-
 #include <stdio.h>
 #include <time.h>
 
@@ -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 ;

+ 7 - 7
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
 

+ 0 - 2
IDE/MDK5-ARM/Projects/EchoServer/main.c

@@ -29,7 +29,6 @@
 #include "rl_net.h"                      /* Network definitions                */
 #include <time.h>
 
-#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 >>> -----------------
 

+ 2 - 2
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 ;

+ 2 - 2
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 ;