@@ -158,19 +158,21 @@ void SystemTask::Work() {
158158 heartRateSensor.Disable ();
159159 heartRateApp.Start ();
160160
161- nrf_gpio_cfg_sense_input (PinMap::Button, ( nrf_gpio_pin_pull_t ) GPIO_PIN_CNF_PULL_Pulldown, ( nrf_gpio_pin_sense_t ) GPIO_PIN_CNF_SENSE_High);
161+ // Button
162162 nrf_gpio_cfg_output (15 );
163163 nrf_gpio_pin_set (15 );
164164
165165 nrfx_gpiote_in_config_t pinConfig;
166- pinConfig.skip_gpio_setup = true ;
166+ pinConfig.skip_gpio_setup = false ;
167167 pinConfig.hi_accuracy = false ;
168168 pinConfig.is_watcher = false ;
169- pinConfig.sense = (nrf_gpiote_polarity_t ) NRF_GPIOTE_POLARITY_HITOLO ;
169+ pinConfig.sense = (nrf_gpiote_polarity_t ) NRF_GPIOTE_POLARITY_TOGGLE ;
170170 pinConfig.pull = (nrf_gpio_pin_pull_t ) GPIO_PIN_CNF_PULL_Pulldown;
171171
172172 nrfx_gpiote_in_init (PinMap::Button, &pinConfig, nrfx_gpiote_evt_handler);
173+ nrfx_gpiote_in_event_enable (PinMap::Button, true );
173174
175+ // Touchscreen
174176 nrf_gpio_cfg_sense_input (PinMap::Cst816sIrq, (nrf_gpio_pin_pull_t ) GPIO_PIN_CNF_PULL_Pullup, (nrf_gpio_pin_sense_t ) GPIO_PIN_CNF_SENSE_Low);
175177
176178 pinConfig.skip_gpio_setup = true ;
@@ -181,18 +183,20 @@ void SystemTask::Work() {
181183
182184 nrfx_gpiote_in_init (PinMap::Cst816sIrq, &pinConfig, nrfx_gpiote_evt_handler);
183185
186+ // Power present
184187 pinConfig.sense = NRF_GPIOTE_POLARITY_TOGGLE;
185188 pinConfig.pull = NRF_GPIO_PIN_NOPULL;
186189 pinConfig.is_watcher = false ;
187190 pinConfig.hi_accuracy = false ;
188- pinConfig.skip_gpio_setup = true ;
191+ pinConfig.skip_gpio_setup = false ;
189192 nrfx_gpiote_in_init (PinMap::PowerPresent, &pinConfig, nrfx_gpiote_evt_handler);
193+ nrfx_gpiote_in_event_enable (PinMap::PowerPresent, true );
190194
191- if (nrf_gpio_pin_read (PinMap::PowerPresent)) {
192- nrf_gpio_cfg_sense_input (PinMap::PowerPresent, NRF_GPIO_PIN_NOPULL, NRF_GPIO_PIN_SENSE_LOW);
193- } else {
194- nrf_gpio_cfg_sense_input (PinMap::PowerPresent, NRF_GPIO_PIN_NOPULL, NRF_GPIO_PIN_SENSE_HIGH);
195- }
195+ // if (nrf_gpio_pin_read(PinMap::PowerPresent)) {
196+ // nrf_gpio_cfg_sense_input(PinMap::PowerPresent, NRF_GPIO_PIN_NOPULL, NRF_GPIO_PIN_SENSE_LOW);
197+ // } else {
198+ // nrf_gpio_cfg_sense_input(PinMap::PowerPresent, NRF_GPIO_PIN_NOPULL, NRF_GPIO_PIN_SENSE_HIGH);
199+ // }
196200
197201 idleTimer = xTimerCreate (" idleTimer" , pdMS_TO_TICKS (2000 ), pdFALSE, this , IdleTimerCallback);
198202 dimTimer = xTimerCreate (" dimTimer" , pdMS_TO_TICKS (settingsController.GetScreenTimeOut () - 2000 ), pdFALSE, this , DimTimerCallback);
0 commit comments