[FL-976] Removing lambdas (#1849)

* Removing lambdas...
* Wake the fk up, Gordon! We have a citadel to burn!
* Here comes the Nihilanth
* Lambda documentation

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
Sergey Gavrilov
2022-10-09 03:38:29 +10:00
committed by GitHub
parent 981f7ff8b0
commit 31c0346adc
43 changed files with 1193 additions and 1007 deletions

View File

@@ -145,29 +145,33 @@ void bad_usb_set_ok_callback(BadUsb* bad_usb, BadUsbOkCallback callback, void* c
furi_assert(bad_usb);
furi_assert(callback);
with_view_model(
bad_usb->view, (BadUsbModel * model) {
bad_usb->view,
BadUsbModel * model,
{
UNUSED(model);
bad_usb->callback = callback;
bad_usb->context = context;
return true;
});
},
true);
}
void bad_usb_set_file_name(BadUsb* bad_usb, const char* name) {
furi_assert(name);
with_view_model(
bad_usb->view, (BadUsbModel * model) {
strlcpy(model->file_name, name, MAX_NAME_LEN);
return true;
});
bad_usb->view,
BadUsbModel * model,
{ strlcpy(model->file_name, name, MAX_NAME_LEN); },
true);
}
void bad_usb_set_state(BadUsb* bad_usb, BadUsbState* st) {
furi_assert(st);
with_view_model(
bad_usb->view, (BadUsbModel * model) {
bad_usb->view,
BadUsbModel * model,
{
memcpy(&(model->state), st, sizeof(BadUsbState));
model->anim_frame ^= 1;
return true;
});
},
true);
}