mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-05-29 12:18:51 +00:00
fix(core): fix nrf start/stop, service listener registration
[no changelog]
This commit is contained in:
parent
e641fb1c25
commit
a71fe4a66e
@ -106,6 +106,11 @@ void nrf_start(void) {
|
|||||||
tsqueue_reset(&drv->tx_queue);
|
tsqueue_reset(&drv->tx_queue);
|
||||||
|
|
||||||
drv->comm_running = true;
|
drv->comm_running = true;
|
||||||
|
|
||||||
|
if (HAL_GPIO_ReadPin(NRF_IN_SPI_REQUEST_PORT, NRF_IN_SPI_REQUEST_PIN) ==
|
||||||
|
GPIO_PIN_SET) {
|
||||||
|
nrf_prepare_spi_data(drv);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void nrf_complete_current_request(nrf_driver_t *drv,
|
static void nrf_complete_current_request(nrf_driver_t *drv,
|
||||||
@ -336,10 +341,11 @@ void nrf_init(void) {
|
|||||||
HAL_SPI_Init(&drv->spi);
|
HAL_SPI_Init(&drv->spi);
|
||||||
|
|
||||||
drv->tx_request_id = -1;
|
drv->tx_request_id = -1;
|
||||||
nrf_register_listener(NRF_SERVICE_MANAGEMENT, nrf_management_rx_cb);
|
|
||||||
|
|
||||||
drv->initialized = true;
|
drv->initialized = true;
|
||||||
|
|
||||||
|
nrf_register_listener(NRF_SERVICE_MANAGEMENT, nrf_management_rx_cb);
|
||||||
|
|
||||||
drv->timer = systimer_create(nrf_timer_callback, drv);
|
drv->timer = systimer_create(nrf_timer_callback, drv);
|
||||||
nrf_start();
|
nrf_start();
|
||||||
|
|
||||||
@ -802,7 +808,7 @@ void NRF_EXTI_INTERRUPT_HANDLER(void) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (drv->initialized) {
|
if (drv->initialized && drv->comm_running) {
|
||||||
if (HAL_GPIO_ReadPin(NRF_OUT_SPI_READY_PORT, NRF_OUT_SPI_READY_PIN) == 0) {
|
if (HAL_GPIO_ReadPin(NRF_OUT_SPI_READY_PORT, NRF_OUT_SPI_READY_PIN) == 0) {
|
||||||
nrf_prepare_spi_data(drv);
|
nrf_prepare_spi_data(drv);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user