mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2024-12-18 19:01:47 +03:00
temp fix for subghz keyboard lock
actually - furi timer is broken :(((((
This commit is contained in:
parent
b84f14386c
commit
5c00a403f6
@ -101,6 +101,24 @@ void subghz_receiver_rssi(SubGhzViewReceiver* instance, float rssi) {
|
|||||||
true);
|
true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void subghz_view_receiver_timer_callback(void* context) {
|
||||||
|
furi_assert(context);
|
||||||
|
SubGhzViewReceiver* subghz_receiver = context;
|
||||||
|
with_view_model(
|
||||||
|
subghz_receiver->view,
|
||||||
|
SubGhzViewReceiverModel * model,
|
||||||
|
{ model->bar_show = SubGhzViewReceiverBarShowDefault; },
|
||||||
|
true);
|
||||||
|
if(subghz_receiver->lock_count < UNLOCK_CNT) {
|
||||||
|
subghz_receiver->callback(
|
||||||
|
SubGhzCustomEventViewReceiverOffDisplay, subghz_receiver->context);
|
||||||
|
} else {
|
||||||
|
subghz_receiver->lock = false;
|
||||||
|
subghz_receiver->callback(SubGhzCustomEventViewReceiverUnlock, subghz_receiver->context);
|
||||||
|
}
|
||||||
|
subghz_receiver->lock_count = 0;
|
||||||
|
}
|
||||||
|
|
||||||
void subghz_view_receiver_set_lock(SubGhzViewReceiver* subghz_receiver, bool lock) {
|
void subghz_view_receiver_set_lock(SubGhzViewReceiver* subghz_receiver, bool lock) {
|
||||||
furi_assert(subghz_receiver);
|
furi_assert(subghz_receiver);
|
||||||
subghz_receiver->lock_count = 0;
|
subghz_receiver->lock_count = 0;
|
||||||
@ -112,6 +130,7 @@ void subghz_view_receiver_set_lock(SubGhzViewReceiver* subghz_receiver, bool loc
|
|||||||
{ model->bar_show = SubGhzViewReceiverBarShowLock; },
|
{ model->bar_show = SubGhzViewReceiverBarShowLock; },
|
||||||
true);
|
true);
|
||||||
furi_timer_start(subghz_receiver->timer, 1000);
|
furi_timer_start(subghz_receiver->timer, 1000);
|
||||||
|
subghz_view_receiver_timer_callback(subghz_receiver);
|
||||||
} else {
|
} else {
|
||||||
with_view_model(
|
with_view_model(
|
||||||
subghz_receiver->view,
|
subghz_receiver->view,
|
||||||
@ -424,24 +443,6 @@ void subghz_view_receiver_draw(Canvas* canvas, SubGhzViewReceiverModel* model) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void subghz_view_receiver_timer_callback(void* context) {
|
|
||||||
furi_assert(context);
|
|
||||||
SubGhzViewReceiver* subghz_receiver = context;
|
|
||||||
with_view_model(
|
|
||||||
subghz_receiver->view,
|
|
||||||
SubGhzViewReceiverModel * model,
|
|
||||||
{ model->bar_show = SubGhzViewReceiverBarShowDefault; },
|
|
||||||
true);
|
|
||||||
if(subghz_receiver->lock_count < UNLOCK_CNT) {
|
|
||||||
subghz_receiver->callback(
|
|
||||||
SubGhzCustomEventViewReceiverOffDisplay, subghz_receiver->context);
|
|
||||||
} else {
|
|
||||||
subghz_receiver->lock = false;
|
|
||||||
subghz_receiver->callback(SubGhzCustomEventViewReceiverUnlock, subghz_receiver->context);
|
|
||||||
}
|
|
||||||
subghz_receiver->lock_count = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool subghz_view_receiver_input(InputEvent* event, void* context) {
|
bool subghz_view_receiver_input(InputEvent* event, void* context) {
|
||||||
furi_assert(context);
|
furi_assert(context);
|
||||||
SubGhzViewReceiver* subghz_receiver = context;
|
SubGhzViewReceiver* subghz_receiver = context;
|
||||||
|
Loading…
Reference in New Issue
Block a user