[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;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user