main.c 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /* main.c
  2. *
  3. * Copyright (C) 2006-2017 wolfSSL Inc.
  4. *
  5. * This file is part of wolfSSL.
  6. *
  7. * wolfSSL is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * wolfSSL is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
  20. */
  21. #ifdef HAVE_CONFIG_H
  22. #include <config.h>
  23. #endif
  24. #include <wolfssl/wolfcrypt/settings.h>
  25. #include "wolfcrypt/test/test.h"
  26. #include <stdio.h>
  27. #include "stm32f2xx_hal.h"
  28. #include "cmsis_os.h"
  29. /*-----------------------------------------------------------------------------
  30. * System Clock Configuration
  31. *----------------------------------------------------------------------------*/
  32. void SystemClock_Config(void) {
  33. #warning "write MPU specific System Clock Set up\n"
  34. }
  35. /*-----------------------------------------------------------------------------
  36. * Initialize a Flash Memory Card
  37. *----------------------------------------------------------------------------*/
  38. #if !defined(NO_FILESYSTEM)
  39. #include "rl_fs.h" /* FileSystem definitions */
  40. static void init_filesystem (void) {
  41. int32_t retv;
  42. retv = finit ("M0:");
  43. if (retv == 0) {
  44. retv = fmount ("M0:");
  45. if (retv == 0) {
  46. printf ("Drive M0 ready!\n");
  47. }
  48. else {
  49. printf ("Drive M0 mount failed!\n");
  50. }
  51. }
  52. else {
  53. printf ("Drive M0 initialization failed!\n");
  54. }
  55. }
  56. #endif
  57. /*-----------------------------------------------------------------------------
  58. * mian entry
  59. *----------------------------------------------------------------------------*/
  60. void benchmark_test(void *arg) ;
  61. int main()
  62. {
  63. void * arg = NULL ;
  64. HAL_Init(); /* Initialize the HAL Library */
  65. SystemClock_Config(); /* Configure the System Clock */
  66. #if !defined(NO_FILESYSTEM)
  67. init_filesystem ();
  68. #endif
  69. osDelay(300) ;
  70. printf("=== Start: Crypt Benchmark ===\n") ;
  71. benchmark_test(arg) ;
  72. printf("=== End: Crypt Benchmark ===\n") ;
  73. }