This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

app_sched_event_put from GPIOTE_IRQHandler

Hi, i'm trying to read an i2c sensor on interrupt. Doing it directly in the interrupt is apparantly bad, so io tried using app_sched_event_put, but that just crashes inside propriatary code.

How do i run stuff from interrupts then?

#0  0x000006b0 in ?? ()
#1  <signal handler called>
#2  0x0001aa8a in sd_nvic_critical_region_enter     (p_is_nested_critical_region=p_is_nested_critical_region@entry=0x20003f87 "")
at ../../components/softdevice/s110/headers/nrf_soc.h:500
#3  0x0001ab20 in app_sched_event_put (p_event_data=p_event_data@entry=0x0, event_data_size=event_data_size@entry=0, 
handler=handler@entry=0x18399 <sensor_event_handler>) at ../../components/libraries/scheduler/app_scheduler.c:102
#4  0x0001851e in GPIOTE_IRQHandler () at main.c:139
#5  <signal handler called>
#6  0x0000d16c in ?? ()
#7  0x0000119a in ?? ()


 void GPIOTE_IRQHandler(void) {
     if (NRF_GPIOTE->EVENTS_PORT) {
          NRF_GPIOTE->EVENTS_PORT = 0;
           app_sched_event_put(NULL, 0, sensor_event_handler);
          }
      }
 } 
Related