Update code to v1.0.14 (10)

This commit is contained in:
Caten
2024-02-29 19:35:00 +08:00
parent c2ee3b694c
commit a956d26f6d
3188 changed files with 2317293 additions and 146 deletions

View File

@@ -0,0 +1,22 @@
# vim:ft=automake
# All paths should be given relative to the root
#
EXTRA_DIST += \
mqx/wolfcrypt_benchmark/.cproject \
mqx/wolfcrypt_benchmark/.project \
mqx/wolfcrypt_benchmark/Debugger/K70FN1M0.mem \
mqx/wolfcrypt_benchmark/Debugger/init_kinetis.tcl \
mqx/wolfcrypt_benchmark/Debugger/mass_erase_kinetis.tcl \
mqx/wolfcrypt_benchmark/ReferencedRSESystems.xml \
mqx/wolfcrypt_benchmark/wolfcrypt_benchmark_twrk70f120m_Int_Flash_DDRData_Debug_PnE_U-MultiLink.launch \
mqx/wolfcrypt_benchmark/wolfcrypt_benchmark_twrk70f120m_Int_Flash_DDRData_Release_PnE_U-MultiLink.launch \
mqx/wolfcrypt_benchmark/wolfcrypt_benchmark_twrk70f120m_Int_Flash_SramData_Debug_JTrace.jlink \
mqx/wolfcrypt_benchmark/wolfcrypt_benchmark_twrk70f120m_Int_Flash_SramData_Debug_JTrace.launch \
mqx/wolfcrypt_benchmark/wolfcrypt_benchmark_twrk70f120m_Int_Flash_SramData_Debug_PnE_U-MultiLink.launch \
mqx/wolfcrypt_benchmark/wolfcrypt_benchmark_twrk70f120m_Int_Flash_SramData_Release_PnE_U-MultiLink.launch
EXTRA_DIST += \
mqx/wolfcrypt_benchmark/Sources/main.c \
mqx/wolfcrypt_benchmark/Sources/main.h

View File

@@ -0,0 +1,94 @@
/* main.c */
#include "main.h"
/* SD card open/close utility functions */
#include "util.h"
#if !BSPCFG_ENABLE_IO_SUBSYSTEM
#error This application requires BSPCFG_ENABLE_IO_SUBSYSTEM defined \
non-zero in user_config.h. Please recompile BSP with this option.
#endif
#ifndef BSP_DEFAULT_IO_CHANNEL_DEFINED
#error This application requires BSP_DEFAULT_IO_CHANNEL to be not NULL. \
Please set corresponding BSPCFG_ENABLE_TTYx to non-zero in \
user_config.h and recompile BSP with this option.
#endif
TASK_TEMPLATE_STRUCT MQX_template_list[] =
{
/* Task number, Entry point, Stack, Pri, String, Auto? */
{MAIN_TASK, Main_task, 30000, 9, "main", MQX_AUTO_START_TASK},
{0, 0, 0, 0, 0, 0, }
};
#if defined BSP_SDCARD_ESDHC_CHANNEL
#if ! BSPCFG_ENABLE_ESDHC
#error This application requires BSPCFG_ENABLE_ESDHC defined \
non-zero in user_config.h. Please recompile libraries with \
this option.
#endif
#elif defined BSP_SDCARD_SDHC_CHANNEL
#if ! BSPCFG_ENABLE_SDHC
#error This application requires BSPCFG_ENABLE_SDHC defined \
non-zero in user_config.h. Please recompile libraries with \
this option.
#endif
#endif
#if defined (BSP_SDCARD_SPI_CHANNEL)
#define SDCARD_COM_CHANNEL BSP_SDCARD_SPI_CHANNEL
#elif defined (BSP_SDCARD_ESDHC_CHANNEL)
#define SDCARD_COM_CHANNEL BSP_SDCARD_ESDHC_CHANNEL
#elif defined (BSP_SDCARD_SDHC_CHANNEL)
#define SDCARD_COM_CHANNEL BSP_SDCARD_SDHC_CHANNEL
#else
#error "SDCARD low level communication device not defined!"
#endif
/* func_args from test.h */
typedef struct func_args {
int argc;
char** argv;
int return_code;
} func_args;
/*TASK*-----------------------------------------------------------------
* Function Name : Main_task
* Comments :
* This task opens the SD card device and runs the
* wolfCrypt benchmark functions located in benchmark.c.
*END------------------------------------------------------------------*/
void Main_task(uint32_t initial_data)
{
int ret = 0;
func_args args;
char filesystem_name[] = "a:";
char partman_name[] = "pm:";
MQX_FILE_PTR com_handle, sdcard_handle, filesystem_handle, partman_handle;
ret = sdcard_open(&com_handle, &sdcard_handle, &partman_handle,
&filesystem_handle, partman_name, filesystem_name);
if (ret != 0) {
printf("error: sdcard_open(), ret = %d\n", ret);
_mqx_exit(1);
}
printf("SD card installed to %s\n", filesystem_name);
benchmark_test(&args);
ret = sdcard_close(&sdcard_handle, &partman_handle,
&filesystem_handle, partman_name, filesystem_name);
if (ret != 0) {
printf("error: sdcard_close(), ret = %d\n", ret);
_mqx_exit(1);
}
printf("SD card uninstalled.\n");
_mqx_exit(0);
}

View File

@@ -0,0 +1,20 @@
/* main.h */
#ifndef __main_h_
#define __main_h_
#include <mqx.h>
#include <bsp.h>
#include <fio.h>
#include <mfs.h>
#include <sdcard.h>
#include <spi.h>
#include <part_mgr.h>
#define MAIN_TASK 1
extern void Main_task (uint32_t);
int benchmark_test(void* args);
#endif /* __main_h_ */