diff options
| author | Kieran Cawthray <kieranc@gmail.com> | 2021-08-15 17:50:56 +0200 |
|---|---|---|
| committer | Kieran Cawthray <kieranc@gmail.com> | 2021-08-15 17:50:56 +0200 |
| commit | 30b32e4c8a750e6434f09a2eaa7cebb5d11a524a (patch) | |
| tree | 8b010fe81ce8c11d8eab5efcf20822fdac418f61 /src/main.cpp | |
| parent | 9851ed33d84aa242dfb98c2c3714a20ddbc53f45 (diff) | |
| parent | ee44b6ff4998d6f4d0672c05c1f65c0a9692dc0d (diff) | |
Merge remote-tracking branch 'upstream/develop' into pinetimestyle-colorpicker
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp index ffbba5e7..d301be67 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -5,6 +5,7 @@ #include <libraries/gpiote/app_gpiote.h> #include <libraries/timer/app_timer.h> #include <softdevice/common/nrf_sdh.h> +#include <nrf_delay.h> // nimble #define min // workaround: nimble's min/max macros conflict with libstdc++ @@ -300,6 +301,20 @@ int main(void) { nrf_drv_clock_init(); + // Unblock i2c? + nrf_gpio_cfg(pinTwiScl, + NRF_GPIO_PIN_DIR_OUTPUT, + NRF_GPIO_PIN_INPUT_DISCONNECT, + NRF_GPIO_PIN_NOPULL, + NRF_GPIO_PIN_S0D1, + NRF_GPIO_PIN_NOSENSE); + nrf_gpio_pin_set(pinTwiScl); + for (uint8_t i = 0; i < 16; i++) { + nrf_gpio_pin_toggle(pinTwiScl); + nrf_delay_us(5); + } + nrf_gpio_cfg_default(pinTwiScl); + debounceTimer = xTimerCreate("debounceTimer", 200, pdFALSE, (void*) 0, DebounceTimerCallback); debounceChargeTimer = xTimerCreate("debounceTimerCharge", 200, pdFALSE, (void*) 0, DebounceTimerChargeCallback); |
