SubGHz: Rework GPS as plugin, fix VGM (#5)

- Streamlined atomic init and deinit
- Load from plugin into RAM dynamically
- Don't attempt load if VGM / Expansion is connected
- Deduplicated some code, cleaned up some other bits
This commit is contained in:
Willy-JL
2024-03-30 03:38:59 +00:00
parent dcb5c50351
commit ef2c955995
15 changed files with 309 additions and 369 deletions

View File

@@ -154,11 +154,17 @@ static void subghz_scene_receiver_config_set_gps(VariableItem* item) {
subghz_last_settings_save(subghz->last_settings);
if(subghz->last_settings->gps_baudrate != 0) {
subghz_gps_stop(subghz->gps);
subghz_gps_set_baudrate(subghz->gps, subghz->last_settings->gps_baudrate);
subghz_gps_start(subghz->gps);
if(subghz->gps) {
furi_hal_serial_set_br(
subghz->gps->serial_handle, subghz->last_settings->gps_baudrate);
} else {
subghz->gps = subghz_gps_plugin_init(subghz->last_settings->gps_baudrate);
}
} else {
subghz_gps_stop(subghz->gps);
if(subghz->gps) {
subghz_gps_plugin_deinit(subghz->gps);
subghz->gps = NULL;
}
}
}