2 Replies Latest reply on Mar 8, 2015 7:32 PM by userc_10377

    how can quick sync ISR->Thread

      Hi,all

       

      I create a thread ,

      wait Semaphores from ISR

       

      I need a very quick to wakeup Thread (maybe < 100us)

       

      but now, I measuring the GPIO (between GPIO_38 ,GPIO_36) is always a  ~1ms

       

       

       

      so how can I quick to wakeup thread ???

       

      void IRQHandler(void)

      {

        wiced_gpio_output_high(WICED_GPIO_38);

        wiced_rtos_set_semaphore(&sem);

        wiced_gpio_output_low(WICED_GPIO_38);

      }

       

      static wiced_thread_function_t isr_thread_main(void *ptr)

      {

          while(1)

          {

              wiced_rtos_get_semaphore(&sem,0xffffffff);

             wiced_gpio_output_high(WICED_GPIO_36);

              Process();

             wiced_gpio_output_low(WICED_GPIO_36);

           }

      }

        • 1. Re: how can quick sync ISR->Thread

          Hi,

          What is the priority of your thread? try to see which thread is grabbing the processor after your interrupt and you need to set priority of your thread higher than this. Offcourse  you have to be carefull not to get too swaped in this thread and hang other main threads like the network thread.

           

          Another Idea is to split your work, do only the urgent part in the IRQ handler (should be short though), and defer what can be delayed to a later no time critical thread.

           

          Regards,

          Bassem

          • 2. Re: how can quick sync ISR->Thread

            Hi,Bassem

            priority is 0


            it should be highest?


             

                wiced_rtos_create_thread(&irq_thread, \

                                                  0 ,\

                                        "IRQ Process",\

                                        &isr_thread_main,

                                        8192,NULL);