mirror of
https://github.com/Cateners/tiny_computer.git
synced 2026-05-20 16:35:47 +08:00
Update code to v1.0.14 (10)
This commit is contained in:
22
android/extern/wolfssl/mqx/wolfcrypt_test/Sources/include.am
vendored
Normal file
22
android/extern/wolfssl/mqx/wolfcrypt_test/Sources/include.am
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
# vim:ft=automake
|
||||
# All paths should be given relative to the root
|
||||
#
|
||||
|
||||
EXTRA_DIST += \
|
||||
mqx/wolfcrypt_test/.cproject \
|
||||
mqx/wolfcrypt_test/.project \
|
||||
mqx/wolfcrypt_test/Debugger/K70FN1M0.mem \
|
||||
mqx/wolfcrypt_test/Debugger/init_kinetis.tcl \
|
||||
mqx/wolfcrypt_test/Debugger/mass_erase_kinetis.tcl \
|
||||
mqx/wolfcrypt_test/ReferencedRSESystems.xml \
|
||||
mqx/wolfcrypt_test/wolfcrypt_test_twrk70f120m_Int_Flash_DDRData_Debug_PnE_U-MultiLink.launch \
|
||||
mqx/wolfcrypt_test/wolfcrypt_test_twrk70f120m_Int_Flash_DDRData_Release_PnE_U-MultiLink.launch \
|
||||
mqx/wolfcrypt_test/wolfcrypt_test_twrk70f120m_Int_Flash_SramData_Debug_JTrace.jlink \
|
||||
mqx/wolfcrypt_test/wolfcrypt_test_twrk70f120m_Int_Flash_SramData_Debug_JTrace.launch \
|
||||
mqx/wolfcrypt_test/wolfcrypt_test_twrk70f120m_Int_Flash_SramData_Debug_PnE_U-MultiLink.launch \
|
||||
mqx/wolfcrypt_test/wolfcrypt_test_twrk70f120m_Int_Flash_SramData_Release_PnE_U-MultiLink.launch
|
||||
|
||||
EXTRA_DIST += \
|
||||
mqx/wolfcrypt_test/Sources/main.c \
|
||||
mqx/wolfcrypt_test/Sources/main.h
|
||||
|
||||
94
android/extern/wolfssl/mqx/wolfcrypt_test/Sources/main.c
vendored
Normal file
94
android/extern/wolfssl/mqx/wolfcrypt_test/Sources/main.c
vendored
Normal 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, 20000, 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 test functions located in test.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);
|
||||
|
||||
wolfcrypt_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);
|
||||
|
||||
}
|
||||
|
||||
20
android/extern/wolfssl/mqx/wolfcrypt_test/Sources/main.h
vendored
Normal file
20
android/extern/wolfssl/mqx/wolfcrypt_test/Sources/main.h
vendored
Normal 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);
|
||||
void wolfcrypt_test(void* args);
|
||||
|
||||
#endif /* __main_h_ */
|
||||
|
||||
Reference in New Issue
Block a user