Fix gpio state isp programmer (#2567)

* ISP: fix state gpio ISP Programmer
* WS: delete string debug

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
Skorpionm 2023-04-07 07:02:29 +04:00 committed by GitHub
parent 89161a7a1e
commit 6cc5f30c84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 5 additions and 9 deletions

View File

@ -152,6 +152,7 @@ bool avr_isp_auto_set_spi_speed_start_pmode(AvrIsp* instance) {
}
}
}
if(instance->spi) avr_isp_spi_sw_free(instance->spi);
return false;
}

View File

@ -198,9 +198,10 @@ bool avr_isp_worker_rw_detect_chip(AvrIspWorkerRW* instance) {
}
avr_isp_end_pmode(instance->avr_isp);
furi_hal_pwm_stop(FuriHalPwmOutputIdLptim2PA4);
} while(0);
furi_hal_pwm_stop(FuriHalPwmOutputIdLptim2PA4);
if(instance->callback) {
if(instance->chip_arr_ind > avr_isp_chip_arr_size) {
instance->callback(instance->context, "No detect", instance->chip_detect, 0);

View File

@ -317,6 +317,7 @@ 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;
}

View File

@ -18,7 +18,6 @@ struct AvrIspSpiSw {
AvrIspSpiSw* avr_isp_spi_sw_init(AvrIspSpiSwSpeed speed) {
AvrIspSpiSw* instance = malloc(sizeof(AvrIspSpiSw));
instance->speed_wait_time = speed;
instance->miso = AVR_ISP_SPI_SW_MISO;
instance->mosi = AVR_ISP_SPI_SW_MOSI;
instance->sck = AVR_ISP_SPI_SW_SCK;
@ -40,7 +39,6 @@ void avr_isp_spi_sw_free(AvrIspSpiSw* instance) {
furi_hal_gpio_init(instance->miso, GpioModeAnalog, GpioPullNo, GpioSpeedLow);
furi_hal_gpio_init(instance->mosi, GpioModeAnalog, GpioPullNo, GpioSpeedLow);
furi_hal_gpio_init(instance->sck, GpioModeAnalog, GpioPullNo, GpioSpeedLow);
free(instance);
}

View File

@ -217,11 +217,6 @@ void ws_protocol_decoder_lacrosse_tx141thbv2_feed(void* context, bool level, uin
ws_protocol_lacrosse_tx141thbv2_const.te_delta * 2) &&
(DURATION_DIFF(duration, ws_protocol_lacrosse_tx141thbv2_const.te_short * 4) <
ws_protocol_lacrosse_tx141thbv2_const.te_delta * 2))) {
FURI_LOG_E(
"WS",
"%llX %d",
instance->decoder.decode_data,
instance->decoder.decode_count_bit);
if((instance->decoder.decode_count_bit ==
ws_protocol_lacrosse_tx141thbv2_const.min_count_bit_for_found) ||
(instance->decoder.decode_count_bit == LACROSSE_TX141TH_BV2_BIT_COUNT)) {