diff --git a/flip_tdi/.catalog/changelog.md b/flip_tdi/.catalog/changelog.md index b6c1b566..168f03d9 100644 --- a/flip_tdi/.catalog/changelog.md +++ b/flip_tdi/.catalog/changelog.md @@ -1,2 +1,6 @@ +## 1.1 + - Fixed crash when connecting to a USB charger instead of a PC + - Fixed crash when connecting to a PC with a companion app running + ## 1.0 - Initial release diff --git a/flip_tdi/application.fam b/flip_tdi/application.fam index 6ef58abe..8de90d84 100644 --- a/flip_tdi/application.fam +++ b/flip_tdi/application.fam @@ -9,7 +9,7 @@ App( ], stack_size=2 * 1024, fap_description="Flipper FTDI232H emulator.", - fap_version="1.0", + fap_version="1.1", fap_icon="flip_tdi_icon_10px.png", fap_category="USB", fap_icon_assets="images", diff --git a/flip_tdi/helpers/ftdi_usb.c b/flip_tdi/helpers/ftdi_usb.c index fdb5a4cf..701d7449 100644 --- a/flip_tdi/helpers/ftdi_usb.c +++ b/flip_tdi/helpers/ftdi_usb.c @@ -180,12 +180,6 @@ static void ftdi_usb_deinit(usbd_device* dev) { ftdi_usb->thread = NULL; ftdi_free(ftdi_usb->ftdi); - - free(ftdi_usb->usb.str_prod_descr); - ftdi_usb->usb.str_prod_descr = NULL; - free(ftdi_usb->usb.str_serial_descr); - ftdi_usb->usb.str_serial_descr = NULL; - free(ftdi_usb); } static void ftdi_usb_send(usbd_device* dev, uint8_t* buf, uint16_t len) { @@ -495,7 +489,7 @@ FtdiUsb* ftdi_usb_start(void) { ftdi_usb->usb.cfg_descr = (void*)&usb_ftdi_cfg_descr; if(!furi_hal_usb_set_config(&ftdi_usb->usb, ftdi_usb)) { - FURI_LOG_E(TAG, "USB locked, cannot start Mass Storage"); + FURI_LOG_E(TAG, "USB locked, cannot start FlipTDI"); free(ftdi_usb->usb.str_prod_descr); free(ftdi_usb->usb.str_serial_descr); free(ftdi_usb); @@ -506,4 +500,5 @@ FtdiUsb* ftdi_usb_start(void) { void ftdi_usb_stop(FtdiUsb* ftdi_usb) { furi_hal_usb_set_config(ftdi_usb->usb_prev, NULL); + free(ftdi_usb); } diff --git a/mass_storage/.catalog/CHANGELOG.md b/mass_storage/.catalog/CHANGELOG.md index a70c145b..ee5f7865 100644 --- a/mass_storage/.catalog/CHANGELOG.md +++ b/mass_storage/.catalog/CHANGELOG.md @@ -1,3 +1,6 @@ +## v.1.5 +Fixed crash when connected to a USB charger instead of a PC + ## v.1.4 Removed call to legacy SDK API diff --git a/mass_storage/application.fam b/mass_storage/application.fam index c65f2735..445675d7 100644 --- a/mass_storage/application.fam +++ b/mass_storage/application.fam @@ -9,7 +9,7 @@ App( ], stack_size=2 * 1024, fap_description="Implements a mass storage device over USB for disk images", - fap_version="1.4", + fap_version="1.5", fap_icon="assets/mass_storage_10px.png", fap_icon_assets="assets", fap_category="USB", diff --git a/mass_storage/helpers/mass_storage_usb.c b/mass_storage/helpers/mass_storage_usb.c index f493203a..f9237305 100644 --- a/mass_storage/helpers/mass_storage_usb.c +++ b/mass_storage/helpers/mass_storage_usb.c @@ -297,12 +297,6 @@ static void usb_deinit(usbd_device* dev) { furi_thread_join(mass->thread); furi_thread_free(mass->thread); mass->thread = NULL; - - free(mass->usb.str_prod_descr); - mass->usb.str_prod_descr = NULL; - free(mass->usb.str_serial_descr); - mass->usb.str_serial_descr = NULL; - free(mass); } static void usb_wakeup(usbd_device* dev) { @@ -478,4 +472,10 @@ MassStorageUsb* mass_storage_usb_start(const char* filename, SCSIDeviceFunc fn) void mass_storage_usb_stop(MassStorageUsb* mass) { furi_hal_usb_set_config(mass->usb_prev, NULL); + + free(mass->usb.str_prod_descr); + mass->usb.str_prod_descr = NULL; + free(mass->usb.str_serial_descr); + mass->usb.str_serial_descr = NULL; + free(mass); }