[FL-2149] SubGhz: Additional frequencies for testing (#920)
* SubGhz: add new frequency for testing * [FL-2149] SubGhz: power reduction for Australia Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
34
applications/subghz/helpers/subghz_testing.c
Normal file
34
applications/subghz/helpers/subghz_testing.c
Normal file
@@ -0,0 +1,34 @@
|
||||
#include "subghz_testing.h"
|
||||
|
||||
const uint32_t subghz_frequencies_testing[] = {
|
||||
/* 300 - 348 */
|
||||
300000000,
|
||||
304500000,
|
||||
313250000,
|
||||
315000000,
|
||||
321950000,
|
||||
348000000,
|
||||
/* 387 - 464 */
|
||||
387000000,
|
||||
433075000, /* LPD433 first */
|
||||
433825000,
|
||||
433920000, /* LPD433 mid */
|
||||
434420000,
|
||||
434775000, /* LPD433 last channels */
|
||||
438900000,
|
||||
464000000,
|
||||
/* 779 - 928 */
|
||||
779000000,
|
||||
868150000,
|
||||
868350000,
|
||||
868550000,
|
||||
915000000,
|
||||
925000000,
|
||||
926500000,
|
||||
927950000,
|
||||
928000000,
|
||||
};
|
||||
|
||||
const uint32_t subghz_frequencies_count_testing =
|
||||
sizeof(subghz_frequencies_testing) / sizeof(uint32_t);
|
||||
const uint32_t subghz_frequencies_433_92_testing = 9;
|
6
applications/subghz/helpers/subghz_testing.h
Normal file
6
applications/subghz/helpers/subghz_testing.h
Normal file
@@ -0,0 +1,6 @@
|
||||
#pragma once
|
||||
#include "../subghz_i.h"
|
||||
|
||||
extern const uint32_t subghz_frequencies_testing[];
|
||||
extern const uint32_t subghz_frequencies_count_testing;
|
||||
extern const uint32_t subghz_frequencies_433_92_testing;
|
@@ -1,5 +1,6 @@
|
||||
#include "subghz_test_carrier.h"
|
||||
#include "../subghz_i.h"
|
||||
#include "../helpers/subghz_testing.h"
|
||||
|
||||
#include <math.h>
|
||||
#include <furi.h>
|
||||
@@ -94,7 +95,7 @@ bool subghz_test_carrier_input(InputEvent* event, void* context) {
|
||||
if(event->key == InputKeyLeft) {
|
||||
if(model->frequency > 0) model->frequency--;
|
||||
} else if(event->key == InputKeyRight) {
|
||||
if(model->frequency < subghz_frequencies_count - 1) model->frequency++;
|
||||
if(model->frequency < subghz_frequencies_count_testing - 1) model->frequency++;
|
||||
} else if(event->key == InputKeyDown) {
|
||||
if(model->path > 0) model->path--;
|
||||
} else if(event->key == InputKeyUp) {
|
||||
@@ -108,7 +109,7 @@ bool subghz_test_carrier_input(InputEvent* event, void* context) {
|
||||
}
|
||||
|
||||
model->real_frequency =
|
||||
furi_hal_subghz_set_frequency(subghz_frequencies[model->frequency]);
|
||||
furi_hal_subghz_set_frequency(subghz_frequencies_testing[model->frequency]);
|
||||
furi_hal_subghz_set_path(model->path);
|
||||
|
||||
if(model->status == SubghzTestCarrierModelStatusRx) {
|
||||
@@ -141,9 +142,9 @@ void subghz_test_carrier_enter(void* context) {
|
||||
|
||||
with_view_model(
|
||||
subghz_test_carrier->view, (SubghzTestCarrierModel * model) {
|
||||
model->frequency = subghz_frequencies_433_92; // 433
|
||||
model->frequency = subghz_frequencies_433_92_testing; // 433
|
||||
model->real_frequency =
|
||||
furi_hal_subghz_set_frequency(subghz_frequencies[model->frequency]);
|
||||
furi_hal_subghz_set_frequency(subghz_frequencies_testing[model->frequency]);
|
||||
model->path = FuriHalSubGhzPathIsolate; // isolate
|
||||
model->rssi = 0.0f;
|
||||
model->status = SubghzTestCarrierModelStatusRx;
|
||||
|
@@ -1,5 +1,6 @@
|
||||
#include "subghz_test_packet.h"
|
||||
#include "../subghz_i.h"
|
||||
#include "../helpers/subghz_testing.h"
|
||||
|
||||
#include <math.h>
|
||||
#include <furi.h>
|
||||
@@ -144,7 +145,7 @@ static bool subghz_test_packet_input(InputEvent* event, void* context) {
|
||||
if(event->key == InputKeyLeft) {
|
||||
if(model->frequency > 0) model->frequency--;
|
||||
} else if(event->key == InputKeyRight) {
|
||||
if(model->frequency < subghz_frequencies_count - 1) model->frequency++;
|
||||
if(model->frequency < subghz_frequencies_count_testing - 1) model->frequency++;
|
||||
} else if(event->key == InputKeyDown) {
|
||||
if(model->path > 0) model->path--;
|
||||
} else if(event->key == InputKeyUp) {
|
||||
@@ -158,7 +159,7 @@ static bool subghz_test_packet_input(InputEvent* event, void* context) {
|
||||
}
|
||||
|
||||
model->real_frequency =
|
||||
furi_hal_subghz_set_frequency(subghz_frequencies[model->frequency]);
|
||||
furi_hal_subghz_set_frequency(subghz_frequencies_testing[model->frequency]);
|
||||
furi_hal_subghz_set_path(model->path);
|
||||
|
||||
if(model->status == SubghzTestPacketModelStatusRx) {
|
||||
@@ -168,7 +169,7 @@ static bool subghz_test_packet_input(InputEvent* event, void* context) {
|
||||
instance->encoder,
|
||||
0x00AABBCC,
|
||||
SUBGHZ_TEST_PACKET_COUNT,
|
||||
subghz_frequencies[model->frequency]);
|
||||
subghz_frequencies_testing[model->frequency]);
|
||||
if(!furi_hal_subghz_start_async_tx(
|
||||
subghz_encoder_princeton_yield, instance->encoder)) {
|
||||
model->status = SubghzTestPacketModelStatusOnlyRx;
|
||||
@@ -191,9 +192,9 @@ void subghz_test_packet_enter(void* context) {
|
||||
|
||||
with_view_model(
|
||||
instance->view, (SubghzTestPacketModel * model) {
|
||||
model->frequency = subghz_frequencies_433_92;
|
||||
model->frequency = subghz_frequencies_433_92_testing;
|
||||
model->real_frequency =
|
||||
furi_hal_subghz_set_frequency(subghz_frequencies[model->frequency]);
|
||||
furi_hal_subghz_set_frequency(subghz_frequencies_testing[model->frequency]);
|
||||
model->path = FuriHalSubGhzPathIsolate; // isolate
|
||||
model->rssi = 0.0f;
|
||||
model->status = SubghzTestPacketModelStatusRx;
|
||||
|
@@ -1,5 +1,6 @@
|
||||
#include "subghz_test_static.h"
|
||||
#include "../subghz_i.h"
|
||||
#include "../helpers/subghz_testing.h"
|
||||
|
||||
#include <math.h>
|
||||
#include <furi.h>
|
||||
@@ -81,7 +82,7 @@ bool subghz_test_static_input(InputEvent* event, void* context) {
|
||||
if(event->key == InputKeyLeft) {
|
||||
if(model->frequency > 0) model->frequency--;
|
||||
} else if(event->key == InputKeyRight) {
|
||||
if(model->frequency < subghz_frequencies_count - 1) model->frequency++;
|
||||
if(model->frequency < subghz_frequencies_count_testing - 1) model->frequency++;
|
||||
} else if(event->key == InputKeyDown) {
|
||||
if(model->button > 0) model->button--;
|
||||
} else if(event->key == InputKeyUp) {
|
||||
@@ -89,13 +90,14 @@ bool subghz_test_static_input(InputEvent* event, void* context) {
|
||||
}
|
||||
}
|
||||
|
||||
model->real_frequency = subghz_frequencies[model->frequency];
|
||||
model->real_frequency = subghz_frequencies_testing[model->frequency];
|
||||
|
||||
if(event->key == InputKeyOk) {
|
||||
NotificationApp* notification = furi_record_open("notification");
|
||||
if(event->type == InputTypePress) {
|
||||
furi_hal_subghz_idle();
|
||||
furi_hal_subghz_set_frequency_and_path(subghz_frequencies[model->frequency]);
|
||||
furi_hal_subghz_set_frequency_and_path(
|
||||
subghz_frequencies_testing[model->frequency]);
|
||||
if(!furi_hal_subghz_tx()) {
|
||||
instance->callback(SubghzTestStaticEventOnlyRx, instance->context);
|
||||
} else {
|
||||
@@ -107,7 +109,7 @@ bool subghz_test_static_input(InputEvent* event, void* context) {
|
||||
instance->encoder,
|
||||
subghz_test_static_keys[model->button],
|
||||
10000,
|
||||
subghz_frequencies[model->frequency]);
|
||||
subghz_frequencies_testing[model->frequency]);
|
||||
|
||||
furi_hal_subghz_start_async_tx(
|
||||
subghz_encoder_princeton_yield, instance->encoder);
|
||||
@@ -145,8 +147,8 @@ void subghz_test_static_enter(void* context) {
|
||||
|
||||
with_view_model(
|
||||
instance->view, (SubghzTestStaticModel * model) {
|
||||
model->frequency = subghz_frequencies_433_92;
|
||||
model->real_frequency = subghz_frequencies[model->frequency];
|
||||
model->frequency = subghz_frequencies_433_92_testing;
|
||||
model->real_frequency = subghz_frequencies_testing[model->frequency];
|
||||
model->button = 0;
|
||||
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user