mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2024-12-23 21:34:35 +03:00
Revert changes due to Null pointer dereference
This commit is contained in:
parent
93035f07aa
commit
8f752b7eee
@ -152,7 +152,6 @@ bool avr_isp_auto_set_spi_speed_start_pmode(AvrIsp* instance) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(instance->spi) avr_isp_spi_sw_free(instance->spi);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -198,10 +198,9 @@ bool avr_isp_worker_rw_detect_chip(AvrIspWorkerRW* instance) {
|
|||||||
}
|
}
|
||||||
avr_isp_end_pmode(instance->avr_isp);
|
avr_isp_end_pmode(instance->avr_isp);
|
||||||
|
|
||||||
|
furi_hal_pwm_stop(FuriHalPwmOutputIdLptim2PA4);
|
||||||
|
|
||||||
} while(0);
|
} while(0);
|
||||||
|
|
||||||
furi_hal_pwm_stop(FuriHalPwmOutputIdLptim2PA4);
|
|
||||||
|
|
||||||
if(instance->callback) {
|
if(instance->callback) {
|
||||||
if(instance->chip_arr_ind > avr_isp_chip_arr_size) {
|
if(instance->chip_arr_ind > avr_isp_chip_arr_size) {
|
||||||
instance->callback(instance->context, "No detect", instance->chip_detect, 0);
|
instance->callback(instance->context, "No detect", instance->chip_detect, 0);
|
||||||
|
@ -317,7 +317,6 @@ static bool avr_isp_prog_auto_set_spi_speed_start_pmode(AvrIspProg* instance) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(instance->spi) avr_isp_spi_sw_free(instance->spi);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,6 +18,7 @@ struct AvrIspSpiSw {
|
|||||||
AvrIspSpiSw* avr_isp_spi_sw_init(AvrIspSpiSwSpeed speed) {
|
AvrIspSpiSw* avr_isp_spi_sw_init(AvrIspSpiSwSpeed speed) {
|
||||||
AvrIspSpiSw* instance = malloc(sizeof(AvrIspSpiSw));
|
AvrIspSpiSw* instance = malloc(sizeof(AvrIspSpiSw));
|
||||||
instance->speed_wait_time = speed;
|
instance->speed_wait_time = speed;
|
||||||
|
|
||||||
instance->miso = AVR_ISP_SPI_SW_MISO;
|
instance->miso = AVR_ISP_SPI_SW_MISO;
|
||||||
instance->mosi = AVR_ISP_SPI_SW_MOSI;
|
instance->mosi = AVR_ISP_SPI_SW_MOSI;
|
||||||
instance->sck = AVR_ISP_SPI_SW_SCK;
|
instance->sck = AVR_ISP_SPI_SW_SCK;
|
||||||
@ -39,6 +40,7 @@ void avr_isp_spi_sw_free(AvrIspSpiSw* instance) {
|
|||||||
furi_hal_gpio_init(instance->miso, GpioModeAnalog, GpioPullNo, GpioSpeedLow);
|
furi_hal_gpio_init(instance->miso, GpioModeAnalog, GpioPullNo, GpioSpeedLow);
|
||||||
furi_hal_gpio_init(instance->mosi, GpioModeAnalog, GpioPullNo, GpioSpeedLow);
|
furi_hal_gpio_init(instance->mosi, GpioModeAnalog, GpioPullNo, GpioSpeedLow);
|
||||||
furi_hal_gpio_init(instance->sck, GpioModeAnalog, GpioPullNo, GpioSpeedLow);
|
furi_hal_gpio_init(instance->sck, GpioModeAnalog, GpioPullNo, GpioSpeedLow);
|
||||||
|
|
||||||
free(instance);
|
free(instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user