mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-24 03:29:57 -07:00
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:
@@ -251,10 +251,8 @@ SubGhz* subghz_alloc(bool alloc_for_tx_only) {
|
||||
//Init Error_str
|
||||
subghz->error_str = furi_string_alloc();
|
||||
|
||||
subghz->gps = subghz_gps_init();
|
||||
if(subghz->last_settings->gps_baudrate != 0) {
|
||||
subghz_gps_set_baudrate(subghz->gps, subghz->last_settings->gps_baudrate);
|
||||
subghz_gps_start(subghz->gps);
|
||||
subghz->gps = subghz_gps_plugin_init(subghz->last_settings->gps_baudrate);
|
||||
}
|
||||
|
||||
return subghz;
|
||||
@@ -352,10 +350,9 @@ void subghz_free(SubGhz* subghz, bool alloc_for_tx_only) {
|
||||
furi_string_free(subghz->file_path_tmp);
|
||||
|
||||
// GPS
|
||||
if(subghz->last_settings->gps_baudrate != 0) {
|
||||
subghz_gps_stop(subghz->gps);
|
||||
if(subghz->gps) {
|
||||
subghz_gps_plugin_deinit(subghz->gps);
|
||||
}
|
||||
subghz_gps_deinit(subghz->gps);
|
||||
|
||||
subghz_last_settings_free(subghz->last_settings);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user