app.c 996 B

12345678910111213141516171819202122232425262728293031323334353637
  1. // app.c
  2. #include <flip_social.h> // Include the FlipSocialApp structure
  3. #include <alloc/flip_social_alloc.h> // Include the allocation functions
  4. /**
  5. * @brief Entry point for the Hello World application.
  6. * @details Initializes the app, runs the view dispatcher, and cleans up upon exit.
  7. * @param p Input parameter - unused
  8. * @return 0 to indicate success, -1 on failure
  9. */
  10. int32_t main_flip_social(void *p)
  11. {
  12. UNUSED(p);
  13. // Initialize the Hello World application
  14. app_instance = flip_social_app_alloc();
  15. if (!app_instance)
  16. {
  17. // Allocation failed
  18. return -1; // Indicate failure
  19. }
  20. if (!flipper_http_ping())
  21. {
  22. FURI_LOG_E(TAG, "Failed to ping the device");
  23. return -1;
  24. }
  25. // Run the view dispatcher
  26. view_dispatcher_run(app_instance->view_dispatcher);
  27. // Free the resources used by the Hello World application
  28. flip_social_app_free(app_instance);
  29. // Return 0 to indicate success
  30. return 0;
  31. }