SubGHz: Show Geo info when GPS is disabled

This commit is contained in:
Willy-JL
2024-04-02 17:53:40 +01:00
parent 0f5e7636d8
commit 708af5b120
4 changed files with 30 additions and 32 deletions

View File

@@ -162,7 +162,7 @@ static float subghz_gps_calc_angle(float lat1, float lon1, float lat2, float lon
return atan2(lat1 - lat2, lon1 - lon2) * 180 / (double)M_PI;
}
static void subghz_gps_get_descr(
static void subghz_gps_cat_realtime(
SubGhzGPS* subghz_gps,
FuriString* descr,
float latitude,
@@ -192,16 +192,11 @@ static void subghz_gps_get_descr(
angle_str = "W";
}
furi_string_printf(
furi_string_cat_printf(
descr,
"Captured at: %f,\r\n"
"%f\r\n"
"\r\n"
"Realtime: Sats: %d\r\n"
"Distance: %.2f%s Dir: %s\r\n"
"GPS time: %02d:%02d:%02d UTC",
(double)latitude,
(double)longitude,
subghz_gps->satellites,
(double)(subghz_gps->satellites > 0 ? distance > 1 ? distance : distance * 1000 : 0),
distance > 1 ? "km" : "m",
@@ -236,7 +231,7 @@ static void subghz_gps_init(SubGhzGPS* subghz_gps, uint32_t baudrate) {
subghz_gps->serial_handle, subghz_gps_uart_on_irq_cb, subghz_gps, false);
subghz_gps->deinit = &subghz_gps_deinit;
subghz_gps->get_descr = &subghz_gps_get_descr;
subghz_gps->cat_realtime = &subghz_gps_cat_realtime;
}
#include <flipper_application/flipper_application.h>