main.c 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #include "main.h"
  2. #include "fatfs/fatfs.h"
  3. #include <furi.h>
  4. #include <api-hal.h>
  5. #include <flipper.h>
  6. int main(void) {
  7. // Initialize FURI layer
  8. furi_init();
  9. // Initialize ST HAL
  10. HAL_Init();
  11. // Flipper API HAL
  12. api_hal_init();
  13. // 3rd party
  14. MX_FATFS_Init();
  15. FURI_LOG_I("HAL", "FATFS OK");
  16. // CMSIS initialization
  17. osKernelInitialize();
  18. FURI_LOG_I("HAL", "KERNEL OK");
  19. // Init flipper
  20. flipper_init();
  21. // Start kernel
  22. osKernelStart();
  23. while (1) {}
  24. }
  25. void Error_Handler(void) {
  26. asm("bkpt 1");
  27. while(1) {}
  28. }
  29. #ifdef USE_FULL_ASSERT
  30. /**
  31. * @brief Reports the name of the source file and the source line number
  32. * where the assert_param error has occurred.
  33. * @param file: pointer to the source file name
  34. * @param line: assert_param error line source number
  35. * @retval None
  36. */
  37. void assert_failed(uint8_t *file, uint32_t line) {
  38. /* USER CODE BEGIN 6 */
  39. /* User can add his own implementation to report the file name and line number,
  40. tex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
  41. /* USER CODE END 6 */
  42. }
  43. #endif /* USE_FULL_ASSERT */