app.c 1.3 KB

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