app.c 877 B

123456789101112131415161718192021222324252627282930313233343536
  1. #include <flip_weather_e.h>
  2. #include <flip_weather_storage.h>
  3. #include "flip_weather_parse.h"
  4. #include <flip_weather_callback.h>
  5. #include <flip_weather_i.h>
  6. #include <flip_weather_free.h>
  7. // Entry point for the FlipWeather application
  8. int32_t flip_weather_app(void *p)
  9. {
  10. // Suppress unused parameter warning
  11. UNUSED(p);
  12. // Initialize the FlipWeather application
  13. FlipWeatherApp *app = flip_weather_app_alloc();
  14. if (!app)
  15. {
  16. FURI_LOG_E(TAG, "Failed to allocate FlipWeatherApp");
  17. return -1;
  18. }
  19. if (!flipper_http_ping())
  20. {
  21. FURI_LOG_E(TAG, "Failed to ping the device");
  22. return -1;
  23. }
  24. // Run the view dispatcher
  25. view_dispatcher_run(app->view_dispatcher);
  26. // Free the resources used by the FlipWeather application
  27. flip_weather_app_free(app);
  28. // Return 0 to indicate success
  29. return 0;
  30. }