diff options
| author | Riku Isokoski <riksu9000@gmail.com> | 2021-08-18 19:07:02 (GMT) |
|---|---|---|
| committer | Riku Isokoski <riksu9000@gmail.com> | 2021-08-18 19:07:02 (GMT) |
| commit | 85c99797dad39348976d92ecf935536f362ee2c5 (patch) | |
| tree | 820a3bbe74993ff6ce6b7f430d187a397a46f363 /src/main.cpp | |
| parent | fe33c756b7326cbf0a6c70822b70cff4dc2e3401 (diff) | |
| parent | df8ea7fe523bb9ec0ac3e24f0b1bebe5743d90cc (diff) | |
Merge branch 'develop' into new_touch_handler
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 dffec28..768389e 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++ @@ -304,6 +305,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); |
