Hi
I am using nRF51822 (pca10001).I am unable to discover my device. I used the ble_app_template_s130_pca10028 as my base and added the code for gpiote handler as following.
static void gpiote_event_handler(nrf_drv_gpiote_pin_t pin, nrf_gpiote_polarity_t action)
{
int32_t count = 0;
count = nrf_drv_gpiote_in_is_set(INPUT_PIN);
our_characteristic_update(&m_our_service, &count);
}
int main(void)
{
uint32_t err_code;
bool erase_bonds;
nrf_drv_gpiote_init();
nrf_drv_gpiote_in_config_t config = GPIOTE_CONFIG_IN_SENSE_LOTOHI(true);
err_code = nrf_drv_gpiote_in_init(INPUT_PIN, &config, gpiote_event_handler);
nrf_drv_gpiote_in_event_enable(INPUT_PIN, true);
I suppose i made mistake in the handler.
Does changing:
nrf_drv_gpiote_in_config_t config = GPIOTE_CONFIG_IN_SENSE_LOTOHI(true);
to
nrf_drv_gpiote_in_config_t config = GPIOTE_CONFIG_IN_SENSE_LOTOHI(false);
resolve my problem
I am in need of urgent help
Thank you