mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-07-25 07:58:12 +00:00
fix(core): fix tropic driver deinitialization
[no changelog]
This commit is contained in:
parent
47d1378d28
commit
ad80d5c1de
@ -145,7 +145,10 @@ bool tropic_hal_init(void) {
|
||||
void tropic_hal_deinit(void) {
|
||||
tropic01_hal_driver_t *drv = &g_tropic01_hal_driver;
|
||||
|
||||
HAL_SPI_DeInit(&drv->spi);
|
||||
if (drv->spi.Instance != NULL) {
|
||||
HAL_SPI_DeInit(&drv->spi);
|
||||
}
|
||||
|
||||
__HAL_RCC_SPI2_FORCE_RESET();
|
||||
__HAL_RCC_SPI2_RELEASE_RESET();
|
||||
__HAL_RCC_SPI2_CLK_DISABLE();
|
||||
|
@ -94,7 +94,9 @@ cleanup:
|
||||
void tropic_deinit(void) {
|
||||
tropic_driver_t *drv = &g_tropic_driver;
|
||||
|
||||
lt_deinit(&drv->handle);
|
||||
if (drv->handle.device != NULL) {
|
||||
lt_deinit(&drv->handle);
|
||||
}
|
||||
|
||||
tropic_hal_deinit();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user