main.c 924 B

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