mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-12-20 17:53:20 +00:00
f45a5dff43
* FuriHal: enable HSI in stop mode only if we use STOP0, proper SMPS selected clock assert * Furi: fix double crash caused by bkpt use outside of debug session * Libs: update ERC and MGG contrast * Fix various crashes with LIB_DEBUG=1 * BadUsb: size_t where it should be and proper printf types * Various fixes and make PVS happy * FuriHal: proper CCID status and make PVS happy * boot: update mode: graceful handling of corrupted stage file --------- Co-authored-by: hedger <hedger@nanode.su>
54 lines
1.1 KiB
C
54 lines
1.1 KiB
C
#pragma once
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#include <furi.h>
|
|
#include <furi_hal.h>
|
|
|
|
typedef enum {
|
|
BadUsbStateInit,
|
|
BadUsbStateNotConnected,
|
|
BadUsbStateIdle,
|
|
BadUsbStateWillRun,
|
|
BadUsbStateRunning,
|
|
BadUsbStateDelay,
|
|
BadUsbStateStringDelay,
|
|
BadUsbStateWaitForBtn,
|
|
BadUsbStatePaused,
|
|
BadUsbStateDone,
|
|
BadUsbStateScriptError,
|
|
BadUsbStateFileError,
|
|
} BadUsbWorkerState;
|
|
|
|
typedef struct {
|
|
BadUsbWorkerState state;
|
|
size_t line_cur;
|
|
size_t line_nb;
|
|
uint32_t delay_remain;
|
|
size_t error_line;
|
|
char error[64];
|
|
} BadUsbState;
|
|
|
|
typedef struct BadUsbScript BadUsbScript;
|
|
|
|
BadUsbScript* bad_usb_script_open(FuriString* file_path);
|
|
|
|
void bad_usb_script_close(BadUsbScript* bad_usb);
|
|
|
|
void bad_usb_script_set_keyboard_layout(BadUsbScript* bad_usb, FuriString* layout_path);
|
|
|
|
void bad_usb_script_start(BadUsbScript* bad_usb);
|
|
|
|
void bad_usb_script_stop(BadUsbScript* bad_usb);
|
|
|
|
void bad_usb_script_start_stop(BadUsbScript* bad_usb);
|
|
|
|
void bad_usb_script_pause_resume(BadUsbScript* bad_usb);
|
|
|
|
BadUsbState* bad_usb_script_get_state(BadUsbScript* bad_usb);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|