mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-11-23 21:13:16 +00:00
Refactor switch case with duplicated code
This commit is contained in:
parent
d55da415c2
commit
fd230b6d09
1 changed files with 7 additions and 19 deletions
|
@ -14,27 +14,15 @@ void subbrute_scene_entrypoint_menu_callback(SubBruteState* context, uint32_t in
|
|||
context->current_scene = SceneSelectFile;
|
||||
break;
|
||||
case SubBruteAttackCAME12bit307:
|
||||
context->frequency = 307800000;
|
||||
context->bit = 12;
|
||||
string_set_str(context->protocol, "CAME");
|
||||
string_set_str(context->preset, "FuriHalSubGhzPresetOok650Async");
|
||||
if(!subbrute_is_frequency_allowed(context)) {
|
||||
return;
|
||||
}
|
||||
context->current_scene = SceneAttack;
|
||||
break;
|
||||
case SubBruteAttackCAME12bit433:
|
||||
context->frequency = 433920000;
|
||||
context->bit = 12;
|
||||
string_set_str(context->protocol, "CAME");
|
||||
string_set_str(context->preset, "FuriHalSubGhzPresetOok650Async");
|
||||
if(!subbrute_is_frequency_allowed(context)) {
|
||||
return;
|
||||
}
|
||||
context->current_scene = SceneAttack;
|
||||
break;
|
||||
case SubBruteAttackCAME12bit868:
|
||||
context->frequency = 868350000;
|
||||
if (index == SubBruteAttackCAME12bit307) {
|
||||
context->frequency = 307800000;
|
||||
} else if (index == SubBruteAttackCAME12bit433) {
|
||||
context->frequency = 433920000;
|
||||
} else if (index == SubBruteAttackCAME12bit868) {
|
||||
context->frequency = 868350000;
|
||||
}
|
||||
context->bit = 12;
|
||||
string_set_str(context->protocol, "CAME");
|
||||
string_set_str(context->preset, "FuriHalSubGhzPresetOok650Async");
|
||||
|
|
Loading…
Reference in a new issue