Skip to content

Commit e51c3ee

Browse files
Riksu9000JF002
authored andcommitted
Try to fix bootloop
1 parent f0e9d13 commit e51c3ee

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/main.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include <libraries/gpiote/app_gpiote.h>
66
#include <libraries/timer/app_timer.h>
77
#include <softdevice/common/nrf_sdh.h>
8+
#include <nrf_delay.h>
89

910
// nimble
1011
#define min // workaround: nimble's min/max macros conflict with libstdc++
@@ -300,6 +301,14 @@ int main(void) {
300301

301302
nrf_drv_clock_init();
302303

304+
// Unblock i2c?
305+
nrf_gpio_cfg_output(pinTwiScl);
306+
for (uint8_t i = 0; i < 16; i++) {
307+
nrf_gpio_pin_toggle(pinTwiScl);
308+
nrf_delay_us(5);
309+
}
310+
nrf_gpio_cfg_default(pinTwiScl);
311+
303312
debounceTimer = xTimerCreate("debounceTimer", 200, pdFALSE, (void*) 0, DebounceTimerCallback);
304313
debounceChargeTimer = xTimerCreate("debounceTimerCharge", 200, pdFALSE, (void*) 0, DebounceTimerChargeCallback);
305314

0 commit comments

Comments
 (0)