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

How can I send hid data with TIMER1_IRQHandler strict every 8ms?

I find it unstable to send hid data, even if I set timer 1 every 8ms to send hid data.

I can catch data bag from wireshark it seems that interval of two data even close to 1ms.

How can this happen?

but if I set timer every 15ms, it become more stable.

But I need send it every 8ms, can you help?

It is very stable in lenovo N700 mouse (nrf51822)

test soft is in attachments

Best regards

MouseMovementRecorder.zip

Parents
  • I try this code

    void mouse_send_on_radio_active_evt(bool radio_active)
    {
              m_radio_active = radio_active;
    	  mouse_sensor_send();
    }
    
    /**@brief Function for initializing the Radio Notification event.
     */
    static void radio_notification_init(void)
    {
        uint32_t err_code;
    
    
        err_code = ble_radio_notification_init(NRF_APP_PRIORITY_HIGH,
                                               NRF_RADIO_NOTIFICATION_DISTANCE_4560US,
                                               mouse_send_on_radio_active_evt);
    
      	APP_ERROR_CHECK(err_code);
    }
    

    and try to executed mouse_sensor_send(); before the connection interval occurs but it's not work as I expected.

Reply
  • I try this code

    void mouse_send_on_radio_active_evt(bool radio_active)
    {
              m_radio_active = radio_active;
    	  mouse_sensor_send();
    }
    
    /**@brief Function for initializing the Radio Notification event.
     */
    static void radio_notification_init(void)
    {
        uint32_t err_code;
    
    
        err_code = ble_radio_notification_init(NRF_APP_PRIORITY_HIGH,
                                               NRF_RADIO_NOTIFICATION_DISTANCE_4560US,
                                               mouse_send_on_radio_active_evt);
    
      	APP_ERROR_CHECK(err_code);
    }
    

    and try to executed mouse_sensor_send(); before the connection interval occurs but it's not work as I expected.

Children
No Data
Related