mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-01 19:54:40 +02:00
Micrium: benchmark fixes
* Time update for v5.8 to avoid rollover issues * define `XSNPRINTF` * `printf` based on Micrium version
This commit is contained in:
@@ -64,10 +64,12 @@
|
|||||||
#undef printf
|
#undef printf
|
||||||
#define printf printx
|
#define printf printx
|
||||||
#elif defined(MICRIUM)
|
#elif defined(MICRIUM)
|
||||||
#include <bsp_ser.h>
|
#if (OS_VERSION < 50000)
|
||||||
void BSP_Ser_Printf (CPU_CHAR* format, ...);
|
#include <bsp_ser.h>
|
||||||
#undef printf
|
void BSP_Ser_Printf (CPU_CHAR* format, ...);
|
||||||
#define printf BSP_Ser_Printf
|
#undef printf
|
||||||
|
#define printf BSP_Ser_Printf
|
||||||
|
#endif
|
||||||
#elif defined(WOLFSSL_ZEPHYR)
|
#elif defined(WOLFSSL_ZEPHYR)
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#define BENCH_EMBEDDED
|
#define BENCH_EMBEDDED
|
||||||
@@ -6027,10 +6029,23 @@ exit_ed_verify:
|
|||||||
#elif defined(MICRIUM)
|
#elif defined(MICRIUM)
|
||||||
double current_time(int reset)
|
double current_time(int reset)
|
||||||
{
|
{
|
||||||
CPU_ERR err;
|
|
||||||
|
|
||||||
|
#if (OS_VERSION < 50000)
|
||||||
|
CPU_ERR err;
|
||||||
(void)reset;
|
(void)reset;
|
||||||
return (double) CPU_TS_Get32()/CPU_TS_TmrFreqGet(&err);
|
return (double) CPU_TS_Get32()/CPU_TS_TmrFreqGet(&err);
|
||||||
|
#else
|
||||||
|
RTOS_ERR err;
|
||||||
|
double ret = 0;
|
||||||
|
OS_TICK tick = OSTimeGet(&err);
|
||||||
|
OS_RATE_HZ rate = OSTimeTickRateHzGet(&err);
|
||||||
|
(void)reset;
|
||||||
|
|
||||||
|
if (RTOS_ERR_CODE_GET(err) == RTOS_ERR_NONE) {
|
||||||
|
ret = ((double)tick)/rate;
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#elif defined(WOLFSSL_ZEPHYR)
|
#elif defined(WOLFSSL_ZEPHYR)
|
||||||
|
|
||||||
|
@@ -1399,6 +1399,7 @@ extern void uITRON4_free(void *p) ;
|
|||||||
#include <lib_mem.h>
|
#include <lib_mem.h>
|
||||||
#include <lib_math.h>
|
#include <lib_math.h>
|
||||||
#include <lib_str.h>
|
#include <lib_str.h>
|
||||||
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#define USE_FAST_MATH
|
#define USE_FAST_MATH
|
||||||
@@ -1468,6 +1469,7 @@ extern void uITRON4_free(void *p) ;
|
|||||||
(void *)(pmem_2), \
|
(void *)(pmem_2), \
|
||||||
(CPU_SIZE_T)(size)) == DEF_YES)) \
|
(CPU_SIZE_T)(size)) == DEF_YES)) \
|
||||||
? 0 : 1)
|
? 0 : 1)
|
||||||
|
#define XSNPRINTF snprintf
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define XMEMMOVE XMEMCPY
|
#define XMEMMOVE XMEMCPY
|
||||||
|
Reference in New Issue
Block a user