furi.c 763 B

1234567891011121314151617181920212223242526
  1. #include "furi.h"
  2. #include <string.h>
  3. #include "queue.h"
  4. void furi_init() {
  5. furi_assert(!furi_kernel_is_irq_or_masked());
  6. furi_assert(xTaskGetSchedulerState() == taskSCHEDULER_NOT_STARTED);
  7. furi_log_init();
  8. furi_record_init();
  9. }
  10. void furi_run() {
  11. furi_assert(!furi_kernel_is_irq_or_masked());
  12. furi_assert(xTaskGetSchedulerState() == taskSCHEDULER_NOT_STARTED);
  13. #if(__ARM_ARCH_7A__ == 0U)
  14. /* Service Call interrupt might be configured before kernel start */
  15. /* and when its priority is lower or equal to BASEPRI, svc instruction */
  16. /* causes a Hard Fault. */
  17. NVIC_SetPriority(SVCall_IRQn, 0U);
  18. #endif
  19. /* Start the kernel scheduler */
  20. vTaskStartScheduler();
  21. }