Skip to content

Commit 2c11115

Browse files
committed
reset: expose _ble_reset
We also need to call it after a Bluetooth firmware upgrade.
1 parent 7b3e13c commit 2c11115

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/reset.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,18 +48,18 @@ static void _show_reset_label(bool status)
4848
}
4949
#endif
5050

51-
#if !defined(TESTING)
52-
static void _ble_reset(void)
51+
void reset_ble(void)
5352
{
53+
#if !defined(TESTING)
5454
struct ringbuffer uart_queue;
5555
uint8_t uart_queue_buf[64];
5656
ringbuffer_init(&uart_queue, &uart_queue_buf[0], sizeof(uart_queue_buf));
5757
da14531_reset(&uart_queue);
5858
while (ringbuffer_num(&uart_queue)) {
5959
uart_poll(NULL, 0, NULL, &uart_queue);
6060
}
61-
}
6261
#endif
62+
}
6363

6464
void reset_reset(bool status)
6565
{
@@ -98,7 +98,7 @@ void reset_reset(bool status)
9898

9999
// The ble chip needs to be restarted to load the new secrets.
100100
if (memory_get_platform() == MEMORY_PLATFORM_BITBOX02_PLUS) {
101-
_ble_reset();
101+
reset_ble();
102102
}
103103

104104
reboot();

src/reset.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@
1717

1818
#include <stdbool.h>
1919

20+
/**
21+
* Restarts the Bluetooth chip. This also means it will re-load the Bluetooth firmware from SPI
22+
* memory.
23+
*/
24+
void reset_ble(void);
25+
2026
/**
2127
* Resets the device:
2228
* - Updates secure chip KDF keys.

0 commit comments

Comments
 (0)