Skip to content
This repository has been archived by the owner on May 22, 2022. It is now read-only.

Commit

Permalink
Fixes #2 by adding vibration during TX
Browse files Browse the repository at this point in the history
  • Loading branch information
jimilinuxguy committed May 19, 2022
1 parent 5eff95f commit 455057d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion applications/universal_rf/universal_rf.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <lib/subghz/transmitter.h>
#include <lib/subghz/subghz_file_encoder_worker.h>
#include <lib/toolbox/path.h>
#include <notification/notification_messages.h>

#define TAG "UniveralRFRemote"

Expand Down Expand Up @@ -57,7 +58,7 @@ static void remote_send_signal(uint32_t frequency, string_t signal, string_t pro
} else {
return;
}

NotificationApp* notification = furi_record_open("notification");
FlipperFormat* flipper_format = flipper_format_string_alloc();
Stream* stream = flipper_format_get_raw_stream(flipper_format);
stream_clean(stream);
Expand All @@ -76,13 +77,19 @@ static void remote_send_signal(uint32_t frequency, string_t signal, string_t pro
TAG, "Transmitting at %lu, repeat %lu. Press CTRL+C to stop\r\n", frequency, repeat);

furi_hal_power_suppress_charge_enter();
notification_message(notification, &sequence_set_vibro_on);

furi_hal_subghz_start_async_tx(subghz_transmitter_yield, transmitter);

while(!(furi_hal_subghz_is_async_tx_complete())) {
FURI_LOG_D(TAG, ".");
fflush(stdout);
osDelay(333);
}
notification_message(notification, &sequence_reset_vibro);

furi_record_close("notification");

furi_hal_subghz_stop_async_tx();
furi_hal_subghz_sleep();

Expand Down

0 comments on commit 455057d

Please sign in to comment.