app.c 1.4 KB

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