diff --git a/applications/external/spectrum_analyzer/spectrum_analyzer.c b/applications/external/spectrum_analyzer/spectrum_analyzer.c index 413c85bd1..345dd008b 100644 --- a/applications/external/spectrum_analyzer/spectrum_analyzer.c +++ b/applications/external/spectrum_analyzer/spectrum_analyzer.c @@ -490,7 +490,7 @@ int32_t spectrum_analyzer_app(void* p) { hstep = WIDE_STEP; break; } - + switch(input.type) { case InputTypeShort: switch(input.key) { @@ -507,13 +507,19 @@ int32_t spectrum_analyzer_app(void* p) { FURI_LOG_D("Spectrum", "center_freq: %lu", model->center_freq); spectrum_analyzer_calculate_frequencies(model); spectrum_analyzer_worker_set_frequencies( - spectrum_analyzer->worker, model->channel0_frequency, model->spacing, model->width); + spectrum_analyzer->worker, + model->channel0_frequency, + model->spacing, + model->width); break; case InputKeyLeft: model->center_freq -= hstep; spectrum_analyzer_calculate_frequencies(model); spectrum_analyzer_worker_set_frequencies( - spectrum_analyzer->worker, model->channel0_frequency, model->spacing, model->width); + spectrum_analyzer->worker, + model->channel0_frequency, + model->spacing, + model->width); FURI_LOG_D("Spectrum", "center_freq: %lu", model->center_freq); break; case InputKeyOk: { @@ -546,7 +552,10 @@ int32_t spectrum_analyzer_app(void* p) { model->mode_change = false; spectrum_analyzer_calculate_frequencies(model); spectrum_analyzer_worker_set_frequencies( - spectrum_analyzer->worker, model->channel0_frequency, model->spacing, model->width); + spectrum_analyzer->worker, + model->channel0_frequency, + model->spacing, + model->width); FURI_LOG_D("Spectrum", "Width: %u", model->width); break; case InputKeyBack: @@ -577,8 +586,9 @@ int32_t spectrum_analyzer_app(void* p) { model->modulation_change = false; spectrum_analyzer_worker_set_modulation( - spectrum_analyzer->worker, - spectrum_analyzer->model->modulation); + spectrum_analyzer->worker, spectrum_analyzer->model->modulation); + break; + default: break; } break; diff --git a/applications/external/spectrum_analyzer/spectrum_analyzer_worker.c b/applications/external/spectrum_analyzer/spectrum_analyzer_worker.c index 7a98f7069..4076e8a04 100644 --- a/applications/external/spectrum_analyzer/spectrum_analyzer_worker.c +++ b/applications/external/spectrum_analyzer/spectrum_analyzer_worker.c @@ -125,8 +125,7 @@ static int32_t spectrum_analyzer_worker_thread(void* context) { 0x00, 0x00, 0x00, - 0x00 - }; + 0x00}; // Narrow modulation const uint8_t narrow_modulation[] = { @@ -186,8 +185,7 @@ static int32_t spectrum_analyzer_worker_thread(void* context) { 0x00, 0x00, 0x00, - 0x00 - }; + 0x00}; const uint8_t* modulations[] = {default_modulation, narrow_modulation}; @@ -197,7 +195,9 @@ static int32_t spectrum_analyzer_worker_thread(void* context) { // FURI_LOG_T("SpectrumWorker", "spectrum_analyzer_worker_thread: Worker Loop"); subghz_devices_idle(instance->radio_device); subghz_devices_load_preset( - instance->radio_device, FuriHalSubGhzPresetCustom, (uint8_t*)modulations[instance->modulation]); + instance->radio_device, + FuriHalSubGhzPresetCustom, + (uint8_t*)modulations[instance->modulation]); //subghz_devices_load_preset( // instance->radio_device, FuriHalSubGhzPresetCustom, (uint8_t*)default_modulation); //furi_hal_subghz_load_custom_preset(modulations[instance->modulation]); @@ -316,15 +316,11 @@ void spectrum_analyzer_worker_set_frequencies( instance->width = width; } -void spectrum_analyzer_worker_set_modulation( - SpectrumAnalyzerWorker* instance, - uint8_t modulation) { +void spectrum_analyzer_worker_set_modulation(SpectrumAnalyzerWorker* instance, uint8_t modulation) { furi_assert(instance); FURI_LOG_D( - "SpectrumWorker", - "spectrum_analyzer_worker_set_modulation - modulation = %u", - modulation); + "SpectrumWorker", "spectrum_analyzer_worker_set_modulation - modulation = %u", modulation); instance->modulation = modulation; } diff --git a/applications/external/spectrum_analyzer/spectrum_analyzer_worker.h b/applications/external/spectrum_analyzer/spectrum_analyzer_worker.h index 65704285d..796f532e6 100644 --- a/applications/external/spectrum_analyzer/spectrum_analyzer_worker.h +++ b/applications/external/spectrum_analyzer/spectrum_analyzer_worker.h @@ -28,9 +28,7 @@ void spectrum_analyzer_worker_set_frequencies( uint32_t spacing, uint8_t width); -void spectrum_analyzer_worker_set_modulation( - SpectrumAnalyzerWorker* instance, - uint8_t modulation); +void spectrum_analyzer_worker_set_modulation(SpectrumAnalyzerWorker* instance, uint8_t modulation); void spectrum_analyzer_worker_start(SpectrumAnalyzerWorker* instance);