app.c 763 B

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