mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-11-26 22:40:25 +00:00
Revert "Merge branch 'fz-dev' into dev"
This reverts commit 03ad1770f8
.
This commit is contained in:
parent
03ad1770f8
commit
3802171009
3 changed files with 5 additions and 51 deletions
|
@ -72,8 +72,6 @@ static int32_t subghz_frequency_analyzer_worker_thread(void* context) {
|
||||||
.frequency_coarse = 0, .rssi_coarse = 0, .frequency_fine = 0, .rssi_fine = 0};
|
.frequency_coarse = 0, .rssi_coarse = 0, .frequency_fine = 0, .rssi_fine = 0};
|
||||||
float rssi = 0;
|
float rssi = 0;
|
||||||
uint32_t frequency = 0;
|
uint32_t frequency = 0;
|
||||||
float rssi_temp = 0;
|
|
||||||
uint32_t frequency_temp = 0;
|
|
||||||
CC1101Status status;
|
CC1101Status status;
|
||||||
|
|
||||||
//Start CC1101
|
//Start CC1101
|
||||||
|
@ -197,9 +195,6 @@ static int32_t subghz_frequency_analyzer_worker_thread(void* context) {
|
||||||
TAG, "=:%u:%f", frequency_rssi.frequency_fine, (double)frequency_rssi.rssi_fine);
|
TAG, "=:%u:%f", frequency_rssi.frequency_fine, (double)frequency_rssi.rssi_fine);
|
||||||
|
|
||||||
instance->sample_hold_counter = 20;
|
instance->sample_hold_counter = 20;
|
||||||
rssi_temp = frequency_rssi.rssi_fine;
|
|
||||||
frequency_temp = frequency_rssi.frequency_fine;
|
|
||||||
|
|
||||||
if(instance->filVal) {
|
if(instance->filVal) {
|
||||||
frequency_rssi.frequency_fine =
|
frequency_rssi.frequency_fine =
|
||||||
subghz_frequency_analyzer_worker_expRunningAverageAdaptive(
|
subghz_frequency_analyzer_worker_expRunningAverageAdaptive(
|
||||||
|
@ -208,10 +203,7 @@ static int32_t subghz_frequency_analyzer_worker_thread(void* context) {
|
||||||
// Deliver callback
|
// Deliver callback
|
||||||
if(instance->pair_callback) {
|
if(instance->pair_callback) {
|
||||||
instance->pair_callback(
|
instance->pair_callback(
|
||||||
instance->context,
|
instance->context, frequency_rssi.frequency_fine, frequency_rssi.rssi_fine);
|
||||||
frequency_rssi.frequency_fine,
|
|
||||||
frequency_rssi.rssi_fine,
|
|
||||||
true);
|
|
||||||
}
|
}
|
||||||
} else if( // Deliver results coarse
|
} else if( // Deliver results coarse
|
||||||
(frequency_rssi.rssi_coarse > instance->trigger_level) &&
|
(frequency_rssi.rssi_coarse > instance->trigger_level) &&
|
||||||
|
@ -223,8 +215,6 @@ static int32_t subghz_frequency_analyzer_worker_thread(void* context) {
|
||||||
(double)frequency_rssi.rssi_coarse);
|
(double)frequency_rssi.rssi_coarse);
|
||||||
|
|
||||||
instance->sample_hold_counter = 20;
|
instance->sample_hold_counter = 20;
|
||||||
rssi_temp = frequency_rssi.rssi_coarse;
|
|
||||||
frequency_temp = frequency_rssi.frequency_coarse;
|
|
||||||
if(instance->filVal) {
|
if(instance->filVal) {
|
||||||
frequency_rssi.frequency_coarse =
|
frequency_rssi.frequency_coarse =
|
||||||
subghz_frequency_analyzer_worker_expRunningAverageAdaptive(
|
subghz_frequency_analyzer_worker_expRunningAverageAdaptive(
|
||||||
|
@ -235,22 +225,14 @@ static int32_t subghz_frequency_analyzer_worker_thread(void* context) {
|
||||||
instance->pair_callback(
|
instance->pair_callback(
|
||||||
instance->context,
|
instance->context,
|
||||||
frequency_rssi.frequency_coarse,
|
frequency_rssi.frequency_coarse,
|
||||||
frequency_rssi.rssi_coarse,
|
frequency_rssi.rssi_coarse);
|
||||||
true);
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if(instance->sample_hold_counter > 0) {
|
if(instance->sample_hold_counter > 0) {
|
||||||
instance->sample_hold_counter--;
|
instance->sample_hold_counter--;
|
||||||
if(instance->sample_hold_counter == 18) {
|
|
||||||
if(instance->pair_callback) {
|
|
||||||
instance->pair_callback(
|
|
||||||
instance->context, frequency_temp, rssi_temp, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
instance->filVal = 0;
|
instance->filVal = 0;
|
||||||
if(instance->pair_callback)
|
if(instance->pair_callback) instance->pair_callback(instance->context, 0, 0);
|
||||||
instance->pair_callback(instance->context, 0, 0, false);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,11 +5,8 @@
|
||||||
|
|
||||||
typedef struct SubGhzFrequencyAnalyzerWorker SubGhzFrequencyAnalyzerWorker;
|
typedef struct SubGhzFrequencyAnalyzerWorker SubGhzFrequencyAnalyzerWorker;
|
||||||
|
|
||||||
typedef void (*SubGhzFrequencyAnalyzerWorkerPairCallback)(
|
typedef void (
|
||||||
void* context,
|
*SubGhzFrequencyAnalyzerWorkerPairCallback)(void* context, uint32_t frequency, float rssi);
|
||||||
uint32_t frequency,
|
|
||||||
float rssi,
|
|
||||||
bool signal);
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint32_t frequency_coarse;
|
uint32_t frequency_coarse;
|
||||||
|
|
|
@ -151,31 +151,6 @@ void subghz_frequency_analyzer_draw_rssi(
|
||||||
canvas_draw_line(canvas, x, y + 3, x + (RSSI_MAX - RSSI_MIN) * 2 / RSSI_SCALE, y + 3);
|
canvas_draw_line(canvas, x, y + 3, x + (RSSI_MAX - RSSI_MIN) * 2 / RSSI_SCALE, y + 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void subghz_frequency_analyzer_history_frequency_draw(
|
|
||||||
Canvas* canvas,
|
|
||||||
SubGhzFrequencyAnalyzerModel* model) {
|
|
||||||
char buffer[64];
|
|
||||||
uint8_t x = 66;
|
|
||||||
uint8_t y = 43;
|
|
||||||
|
|
||||||
canvas_set_font(canvas, FontKeyboard);
|
|
||||||
for(uint8_t i = 0; i < 3; i++) {
|
|
||||||
if(model->history_frequency[i]) {
|
|
||||||
snprintf(
|
|
||||||
buffer,
|
|
||||||
sizeof(buffer),
|
|
||||||
"%03ld.%03ld",
|
|
||||||
model->history_frequency[i] / 1000000 % 1000,
|
|
||||||
model->history_frequency[i] / 1000 % 1000);
|
|
||||||
canvas_draw_str(canvas, x, y + i * 10, buffer);
|
|
||||||
} else {
|
|
||||||
canvas_draw_str(canvas, x, y + i * 10, "---.---");
|
|
||||||
}
|
|
||||||
canvas_draw_str(canvas, x + 44, y + i * 10, "MHz");
|
|
||||||
}
|
|
||||||
canvas_set_font(canvas, FontSecondary);
|
|
||||||
}
|
|
||||||
|
|
||||||
void subghz_frequency_analyzer_draw(Canvas* canvas, SubGhzFrequencyAnalyzerModel* model) {
|
void subghz_frequency_analyzer_draw(Canvas* canvas, SubGhzFrequencyAnalyzerModel* model) {
|
||||||
char buffer[64];
|
char buffer[64];
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue