app.c 867 B

123456789101112131415161718192021222324252627282930313233
  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. // Suppress unused parameter warning
  10. UNUSED(p);
  11. // Initialize the FlipWeather application
  12. FlipWeatherApp* app = flip_weather_app_alloc();
  13. if(!app) {
  14. FURI_LOG_E(TAG, "Failed to allocate FlipWeatherApp");
  15. return -1;
  16. }
  17. if(!flipper_http_ping()) {
  18. FURI_LOG_E(TAG, "Failed to ping the device");
  19. return -1;
  20. }
  21. // Run the view dispatcher
  22. view_dispatcher_run(app->view_dispatcher);
  23. // Free the resources used by the FlipWeather application
  24. flip_weather_app_free(app);
  25. // Return 0 to indicate success
  26. return 0;
  27. }