app.c 845 B

1234567891011121314151617181920212223242526272829303132333435
  1. #include <flip_library_e.h>
  2. #include <flip_library_storage.h>
  3. #include <flip_library_callback.h>
  4. #include <flip_library_i.h>
  5. #include <flip_library_free.h>
  6. // Entry point for the FlipLibrary application
  7. int32_t flip_library_app(void *p)
  8. {
  9. // Suppress unused parameter warning
  10. UNUSED(p);
  11. // Initialize the FlipLibrary application
  12. FlipLibraryApp *app = flip_library_app_alloc();
  13. if (!app)
  14. {
  15. FURI_LOG_E(TAG, "Failed to allocate FlipLibraryApp");
  16. return -1;
  17. }
  18. if (!flipper_http_ping())
  19. {
  20. FURI_LOG_E(TAG, "Failed to ping the device");
  21. return -1;
  22. }
  23. // Run the view dispatcher
  24. view_dispatcher_run(app->view_dispatcher);
  25. // Free the resources used by the FlipLibrary application
  26. flip_library_app_free(app);
  27. // Return 0 to indicate success
  28. return 0;
  29. }