mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-12 17:38:36 -07:00
Update apps
This commit is contained in:
@@ -10,12 +10,11 @@ App(
|
||||
"dialogs",
|
||||
],
|
||||
stack_size=6 * 1024,
|
||||
order=64, # keep it at the bottom of the list while still WIP
|
||||
fap_icon="icons/mag_10px.png",
|
||||
fap_category="GPIO",
|
||||
fap_icon_assets="icons",
|
||||
fap_version=(0, 5), # major, minor
|
||||
fap_description="WIP MagSpoof port using the RFID subsystem",
|
||||
fap_author="Zachary Weiss",
|
||||
fap_weburl="https://github.com/hummusec/magspoof_flipper", # Original by zacharyweiss
|
||||
fap_weburl="https://github.com/zacharyweiss/magspoof_flipper",
|
||||
)
|
||||
|
||||
@@ -153,7 +153,6 @@ void tx_deinit_rfid() {
|
||||
furi_hal_gpio_write(RFID_PIN_OUT, 0);
|
||||
|
||||
furi_hal_rfid_pins_reset();
|
||||
furi_hal_power_disable_otg();
|
||||
}
|
||||
|
||||
void tx_init_rf(int hz) {
|
||||
@@ -187,7 +186,6 @@ bool tx_init(MagSetting* setting) {
|
||||
tx_init_rfid();
|
||||
break;
|
||||
case MagTxStateGPIO:
|
||||
furi_hal_power_enable_otg();
|
||||
// gpio_item_configure_all_pins(GpioModeOutputPushPull);
|
||||
furi_hal_gpio_init(GPIO_PIN_A, GpioModeOutputPushPull, GpioPullNo, GpioSpeedLow);
|
||||
furi_hal_gpio_init(GPIO_PIN_B, GpioModeOutputPushPull, GpioPullNo, GpioSpeedLow);
|
||||
@@ -238,7 +236,6 @@ bool tx_deinit(MagSetting* setting) {
|
||||
furi_hal_gpio_init(GPIO_PIN_ENABLE, GpioModeAnalog, GpioPullNo, GpioSpeedLow);
|
||||
|
||||
//gpio_item_configure_all_pins(GpioModeAnalog);
|
||||
furi_hal_power_disable_otg();
|
||||
break;
|
||||
case MagTxStatePiezo:
|
||||
tx_deinit_piezo();
|
||||
|
||||
23
applications/external/magspoof/mag.c
vendored
23
applications/external/magspoof/mag.c
vendored
@@ -168,16 +168,39 @@ int32_t mag_app(void* p) {
|
||||
Mag* mag = mag_alloc();
|
||||
UNUSED(p);
|
||||
|
||||
mag_make_app_folder(mag);
|
||||
|
||||
// Enable 5v power, multiple attempts to avoid issues with power chip protection false triggering
|
||||
uint8_t attempts = 0;
|
||||
bool otg_was_enabled = furi_hal_power_is_otg_enabled();
|
||||
while(!furi_hal_power_is_otg_enabled() && attempts++ < 5) {
|
||||
furi_hal_power_enable_otg();
|
||||
furi_delay_ms(10);
|
||||
}
|
||||
|
||||
view_dispatcher_attach_to_gui(mag->view_dispatcher, mag->gui, ViewDispatcherTypeFullscreen);
|
||||
scene_manager_next_scene(mag->scene_manager, MagSceneStart);
|
||||
|
||||
view_dispatcher_run(mag->view_dispatcher);
|
||||
|
||||
// Disable 5v power
|
||||
if(furi_hal_power_is_otg_enabled() && !otg_was_enabled) {
|
||||
furi_hal_power_disable_otg();
|
||||
}
|
||||
|
||||
mag_free(mag);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void mag_make_app_folder(Mag* mag) {
|
||||
furi_assert(mag);
|
||||
|
||||
if(!storage_simply_mkdir(mag->storage, MAG_APP_FOLDER)) {
|
||||
dialog_message_show_storage_error(mag->dialogs, "Cannot create\napp folder");
|
||||
}
|
||||
}
|
||||
|
||||
void mag_text_store_set(Mag* mag, const char* text, ...) {
|
||||
furi_assert(mag);
|
||||
va_list args;
|
||||
|
||||
2
applications/external/magspoof/mag_device.c
vendored
2
applications/external/magspoof/mag_device.c
vendored
@@ -76,6 +76,8 @@ static bool mag_device_save_file(
|
||||
// Make path to file to be saved
|
||||
furi_string_cat_printf(temp_str, "/%s%s", dev_name, extension);
|
||||
} else {
|
||||
// Create mag directory if necessary
|
||||
if(!storage_simply_mkdir((mag_dev->storage), MAG_APP_FOLDER)) break;
|
||||
// First remove mag device file if it was saved
|
||||
furi_string_printf(temp_str, "%s/%s%s", folder, dev_name, extension);
|
||||
}
|
||||
|
||||
2
applications/external/magspoof/mag_i.h
vendored
2
applications/external/magspoof/mag_i.h
vendored
@@ -92,6 +92,8 @@ void mag_text_store_clear(Mag* mag);
|
||||
|
||||
void mag_show_loading_popup(void* context, bool show);
|
||||
|
||||
void mag_make_app_folder(Mag* mag);
|
||||
|
||||
void mag_popup_timeout_callback(void* context);
|
||||
|
||||
void mag_widget_callback(GuiButtonType result, InputType type, void* context);
|
||||
|
||||
Reference in New Issue
Block a user