mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-14 16:18:35 -07:00
spectrum analyzer new mode
This commit is contained in:
@@ -6,8 +6,6 @@
|
||||
#include <stdlib.h>
|
||||
#include "spectrum_analyzer.h"
|
||||
|
||||
#include <gui/gui.h>
|
||||
|
||||
#include <lib/drivers/cc1101_regs.h>
|
||||
#include "spectrum_analyzer_worker.h"
|
||||
|
||||
@@ -64,6 +62,10 @@ void spectrum_analyzer_draw_scale(Canvas* canvas, const SpectrumAnalyzerModel* m
|
||||
tag_left = model->center_freq - 2;
|
||||
tag_right = model->center_freq + 2;
|
||||
break;
|
||||
case ULTRANARROW:
|
||||
tag_left = model->center_freq - 1;
|
||||
tag_right = model->center_freq + 1;
|
||||
break;
|
||||
case ULTRAWIDE:
|
||||
tag_left = model->center_freq - 40;
|
||||
tag_right = model->center_freq + 40;
|
||||
@@ -194,6 +196,11 @@ void spectrum_analyzer_calculate_frequencies(SpectrumAnalyzerModel* model) {
|
||||
step = NARROW_STEP;
|
||||
model->spacing = NARROW_SPACING;
|
||||
break;
|
||||
case ULTRANARROW:
|
||||
margin = ULTRANARROW_MARGIN;
|
||||
step = ULTRANARROW_STEP;
|
||||
model->spacing = ULTRANARROW_SPACING;
|
||||
break;
|
||||
case ULTRAWIDE:
|
||||
margin = ULTRAWIDE_MARGIN;
|
||||
step = ULTRAWIDE_STEP;
|
||||
@@ -392,6 +399,9 @@ int32_t spectrum_analyzer_app(void* p) {
|
||||
case NARROW:
|
||||
hstep = NARROW_STEP;
|
||||
break;
|
||||
case ULTRANARROW:
|
||||
hstep = ULTRANARROW_STEP;
|
||||
break;
|
||||
case ULTRAWIDE:
|
||||
hstep = ULTRAWIDE_STEP;
|
||||
break;
|
||||
@@ -429,13 +439,19 @@ int32_t spectrum_analyzer_app(void* p) {
|
||||
model->width = NARROW;
|
||||
break;
|
||||
case NARROW:
|
||||
model->width = ULTRANARROW;
|
||||
break;
|
||||
case ULTRANARROW:
|
||||
model->width = ULTRAWIDE;
|
||||
break;
|
||||
case ULTRAWIDE:
|
||||
model->width = WIDE;
|
||||
break;
|
||||
default:
|
||||
model->width = WIDE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
spectrum_analyzer_calculate_frequencies(model);
|
||||
spectrum_analyzer_worker_set_frequencies(
|
||||
spectrum_analyzer->worker, model->channel0_frequency, model->spacing, model->width);
|
||||
|
||||
Reference in New Issue
Block a user