main.c 927 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. asm("bkpt 1");
  24. while(1) {}
  25. }
  26. #ifdef USE_FULL_ASSERT
  27. /**
  28. * @brief Reports the name of the source file and the source line number
  29. * where the assert_param error has occurred.
  30. * @param file: pointer to the source file name
  31. * @param line: assert_param error line source number
  32. * @retval None
  33. */
  34. void assert_failed(uint8_t *file, uint32_t line) {
  35. furi_crash("HAL assert failed");
  36. }
  37. #endif /* USE_FULL_ASSERT */