[FL-2129] SubGhz: Fix Duty cycle at 433/868 (#892)
* [FL-2129] SubGhz: Fix Duty cycle at 433/868 * SubGhz: fix syntax * SubGhz: increased silence time in the 868 range * SubGhz: added build flag LAB_TESTS * SubGhz: better LAB_TESTS flag handling * NFC: LAB_TESTS flag handling Co-authored-by: DrZlo13 <who.just.the.doctor@gmail.com>
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
#include <toolbox/level_duration.h>
|
||||
#include <lib/subghz/protocols/subghz_protocol_princeton.h>
|
||||
|
||||
#define SUBGHZ_TEST_PACKET_COUNT 1000
|
||||
#define SUBGHZ_TEST_PACKET_COUNT 500
|
||||
|
||||
struct SubghzTestPacket {
|
||||
View* view;
|
||||
@@ -137,6 +137,7 @@ static bool subghz_test_packet_input(InputEvent* event, void* context) {
|
||||
if(model->status == SubghzTestPacketModelStatusRx) {
|
||||
furi_hal_subghz_stop_async_rx();
|
||||
} else if(model->status == SubghzTestPacketModelStatusTx) {
|
||||
subghz_encoder_princeton_stop(instance->encoder, millis());
|
||||
furi_hal_subghz_stop_async_tx();
|
||||
}
|
||||
|
||||
@@ -164,7 +165,10 @@ static bool subghz_test_packet_input(InputEvent* event, void* context) {
|
||||
furi_hal_subghz_start_async_rx(subghz_test_packet_rx_callback, instance);
|
||||
} else {
|
||||
subghz_encoder_princeton_set(
|
||||
instance->encoder, 0x00AABBCC, SUBGHZ_TEST_PACKET_COUNT);
|
||||
instance->encoder,
|
||||
0x00AABBCC,
|
||||
SUBGHZ_TEST_PACKET_COUNT,
|
||||
subghz_frequencies[model->frequency]);
|
||||
if(!furi_hal_subghz_start_async_tx(
|
||||
subghz_encoder_princeton_yield, instance->encoder)) {
|
||||
model->status = SubghzTestPacketModelStatusOnlyRx;
|
||||
@@ -213,6 +217,7 @@ void subghz_test_packet_exit(void* context) {
|
||||
if(model->status == SubghzTestPacketModelStatusRx) {
|
||||
furi_hal_subghz_stop_async_rx();
|
||||
} else if(model->status == SubghzTestPacketModelStatusTx) {
|
||||
subghz_encoder_princeton_stop(instance->encoder, millis());
|
||||
furi_hal_subghz_stop_async_tx();
|
||||
}
|
||||
return true;
|
||||
|
@@ -104,7 +104,10 @@ bool subghz_test_static_input(InputEvent* event, void* context) {
|
||||
FURI_LOG_I(TAG, "TX Start");
|
||||
|
||||
subghz_encoder_princeton_set(
|
||||
instance->encoder, subghz_test_static_keys[model->button], 10000);
|
||||
instance->encoder,
|
||||
subghz_test_static_keys[model->button],
|
||||
10000,
|
||||
subghz_frequencies[model->frequency]);
|
||||
|
||||
furi_hal_subghz_start_async_tx(
|
||||
subghz_encoder_princeton_yield, instance->encoder);
|
||||
@@ -113,6 +116,7 @@ bool subghz_test_static_input(InputEvent* event, void* context) {
|
||||
} else if(event->type == InputTypeRelease) {
|
||||
if(instance->satus_tx == SubghzTestStaticStatusTX) {
|
||||
FURI_LOG_I(TAG, "TX Stop");
|
||||
subghz_encoder_princeton_stop(instance->encoder, millis());
|
||||
subghz_encoder_princeton_print_log(instance->encoder);
|
||||
furi_hal_subghz_stop_async_tx();
|
||||
notification_message(notification, &sequence_reset_red);
|
||||
|
Reference in New Issue
Block a user