main.c 991 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #include "main.h"
  2. #include <furi.h>
  3. #include <furi_hal.h>
  4. #include <flipper.h>
  5. #define TAG "Main"
  6. int main(void) {
  7. // Flipper critical FURI HAL
  8. furi_hal_init_critical();
  9. // Initialize FURI layer
  10. furi_init();
  11. // Initialize ST HAL
  12. HAL_Init();
  13. // Flipper FURI HAL
  14. furi_hal_init();
  15. // CMSIS initialization
  16. osKernelInitialize();
  17. FURI_LOG_I(TAG, "KERNEL OK");
  18. // Init flipper
  19. flipper_init();
  20. // Start kernel
  21. osKernelStart();
  22. while(1) {
  23. }
  24. }
  25. void Error_Handler(void) {
  26. furi_crash("ErrorHandler");
  27. }
  28. #ifdef USE_FULL_ASSERT
  29. /**
  30. * @brief Reports the name of the source file and the source line number
  31. * where the assert_param error has occurred.
  32. * @param file: pointer to the source file name
  33. * @param line: assert_param error line source number
  34. * @retval None
  35. */
  36. void assert_failed(uint8_t* file, uint32_t line) {
  37. furi_crash("HAL assert failed");
  38. }
  39. #endif /* USE_FULL_ASSERT */