mirror of https://github.com/wolfSSL/wolfssl.git
102 lines
2.6 KiB
C
102 lines
2.6 KiB
C
/* main.c
|
|
*
|
|
* Copyright (C) 2006-2017 wolfSSL Inc.
|
|
*
|
|
* This file is part of wolfSSL.
|
|
*
|
|
* wolfSSL is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* wolfSSL is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write to the Free Software
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
|
|
*/
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
#include <config.h>
|
|
#endif
|
|
|
|
#include <wolfssl/wolfcrypt/settings.h>
|
|
|
|
#include "wolfcrypt/test/test.h"
|
|
|
|
#include <stdio.h>
|
|
|
|
/*-----------------------------------------------------------------------------
|
|
* MPU Depend Configurations
|
|
*----------------------------------------------------------------------------*/
|
|
|
|
#warning "write MPU specific Set up\n"
|
|
|
|
static void MPU_Config (void) {
|
|
|
|
}
|
|
|
|
static void CPU_CACHE_Enable (void) {
|
|
|
|
}
|
|
|
|
static void SystemClock_Config (void) {
|
|
|
|
}
|
|
|
|
extern uint32_t os_time;
|
|
|
|
uint32_t HAL_GetTick(void) {
|
|
return os_time;
|
|
}
|
|
|
|
/*-----------------------------------------------------------------------------
|
|
* Initialize a Flash Memory Card
|
|
*----------------------------------------------------------------------------*/
|
|
#if !defined(NO_FILESYSTEM)
|
|
#include "rl_fs.h" /* FileSystem definitions */
|
|
|
|
static void init_filesystem (void) {
|
|
int32_t retv;
|
|
|
|
retv = finit ("M0:");
|
|
if (retv == fsOK) {
|
|
retv = fmount ("M0:");
|
|
if (retv == fsOK) {
|
|
printf ("Drive M0 ready!\n");
|
|
}
|
|
else {
|
|
printf ("Drive M0 mount failed(%d)!\n", retv);
|
|
}
|
|
}
|
|
else {
|
|
printf ("Drive M0 initialization failed!\n");
|
|
}
|
|
}
|
|
#endif
|
|
|
|
/*-----------------------------------------------------------------------------
|
|
* mian entry
|
|
*----------------------------------------------------------------------------*/
|
|
|
|
int main()
|
|
{
|
|
void * arg = NULL ;
|
|
MPU_Config();
|
|
CPU_CACHE_Enable();
|
|
HAL_Init(); /* Initialize the HAL Library */
|
|
SystemClock_Config(); /* Configure the System Clock */
|
|
|
|
#if !defined(NO_FILESYSTEM)
|
|
init_filesystem ();
|
|
#endif
|
|
|
|
printf("=== Start: Crypt test === (%d)\n", os_time) ;
|
|
wolfcrypt_test(arg) ;
|
|
printf("=== End: Crypt test ===\n") ;
|
|
|
|
}
|