Skip to content

Commit

Permalink
spaces in gps will not let it to download weather
Browse files Browse the repository at this point in the history
  • Loading branch information
ELY M committed Oct 14, 2024
1 parent 718fca9 commit b5862a2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 18 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ The video of the app in action on my switch: https://youtu.be/pFggAxKcNsw
This weather homebrew app only get you weather info like Temp or Condition.

you need to set your GPS in the setting by press - button.
It is important to not leave any spaces. It must be like this
40.1231,-90.3001

Press A or X to get weather info.

Expand Down
14 changes: 4 additions & 10 deletions source/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include <time.h>

#include <switch.h>
#include <curl/curl.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_events.h>
#include <SDL2/SDL_image.h>
Expand Down Expand Up @@ -192,7 +191,7 @@ static bool setMyGPS(void)
char *tmpout = NULL;
bool err = false;

tmpout = popKeyboard("set your GPS like this 39.232,-93.75", 256);
tmpout = popKeyboard("set your GPS like this 39.232,-93.75 - Make sure you do not leave any spaces", 256);

if (tmpout != NULL) {
if (*tmpout == 0) {
Expand Down Expand Up @@ -501,8 +500,8 @@ int main()
mygps = readMyGPS();
lat = strtok(mygps, ",");
lon = strtok(NULL, ",");
char gpsstring[100];
snprintf(gpsstring, 100, "My GPS: %s,%s", lat,lon);
char gpsstring[256];
snprintf(gpsstring, 256, "My GPS: %s,%s", lat,lon);
SDL_DrawTextf(renderer, font, SCREEN_WIDTH / 2, 43, CYAN, gpsstring);


Expand Down Expand Up @@ -543,12 +542,7 @@ int main()
}

if (kDown & HidNpadButton_Plus) { break; }








SDL_RenderPresent(renderer);

Expand Down
8 changes: 0 additions & 8 deletions weather.txt

This file was deleted.

0 comments on commit b5862a2

Please sign in to comment.