app.c 974 B

12345678910111213141516171819202122232425262728293031323334
  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. UNUSED(p);
  12. // Initialize the Hello World application
  13. app_instance = flip_social_app_alloc();
  14. if(!app_instance) {
  15. // Allocation failed
  16. return -1; // Indicate failure
  17. }
  18. if(!flipper_http_ping()) {
  19. FURI_LOG_E(TAG, "Failed to ping the device");
  20. return -1;
  21. }
  22. // Run the view dispatcher
  23. view_dispatcher_run(app_instance->view_dispatcher);
  24. // Free the resources used by the Hello World application
  25. flip_social_app_free(app_instance);
  26. // Return 0 to indicate success
  27. return 0;
  28. }