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:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user