5 Replies Latest reply on Dec 2, 2015 9:34 PM by userc_21243

    what happened after bleprofile_PrepareHidOff()

      hi.

       

      i use 20736S custom board and just met a problem.

      please tell me something wrong or missed.

       

      after boot, my code enter deep sleep by button event or timeout.

      button event wakeup is ok.

      after then, i hope to enter deep sleep again.

      at this time, button event is success, but next log message show repeatedly.

       

      11:53:35   bleprofile_queryPowersave(POWEROFF): 00000000

      11:53:35   bleprofile_queryPowersave(POWEROFF): 00000001

      11:53:35   bleprofile_queryPowersave(POWEROFF): 00000001

      11:53:35   bleprofile_queryPowersave(POWEROFF): 00000000

      11:53:35   bleprofile_queryPowersave(POWEROFF): 00000001

      11:53:35   bleprofile_queryPowersave(POWEROFF): 00000001

      11:53:35   bleprofile_queryPowersave(POWEROFF): 00000000

      11:53:35   bleprofile_queryPowersave(POWEROFF): 00000001

      11:53:35   bleprofile_queryPowersave(POWEROFF): 00000001

      ...

       

      next is my code

       

      ds_create()

      {

      ...

      bleprofile_regAppEvtHandler(BLECM_APP_EVT_ENTERING_HIDOFF, (BLECM_NO_PARAM_FUNC)app_enter_hidoff);

      bleprofile_regAppEvtHandler(BLECM_APP_EVT_ABORTING_HIDOFF, (BLECM_NO_PARAM_FUNC)app_abort_hidoff);

      ...

      devlpm_init();

      devlpm_enableWakeFrom(DEV_LPM_WAKE_SOURCE_GPIO);

      interrupt_handler_mask[GPIO_PUSH_BTN / 16] |= (1 << (GPIO_PUSH_BTN % 16));

      gpio_registerForInterrupt(interrupt_handler_mask, gpio_intr_handler, NULL);

      gpio_configurePin(GPIO_PUSH_BTN / 16, GPIO_PUSH_BTN % 16, GPIO_EN_INT_RISING_EDGE, GPIO_PIN_OUTPUT_HIGH);

      ...

      }

      app_enter_hidoff() {}

      app_abort_hidoff() {}

      ds_timeout()

      {

      bleapputils_delayUs(500);

      bleprofile_Discoverable(NO_DISCOVERABLE, NULL);

      bleprofile_PrepareHidOff();

      }

       

       

      Why 1st time ok, but every 2nd time make infinite loop?

       

      thanks.