Increment gesture Timestamp

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
dabo_4430311
Level 2
Level 2
10 replies posted 10 questions asked 10 sign-ins

Hi everyone, is it fine to call the callback function to increment the timestampgesture only once?

I read that I should call it before ProcessWidget and also before DecodeWidgetGesture, should I call it again or could just once at the beginning be enough? Maybe right before Process_Widget? Is it better 1ms or 2ms

PS, the code implements also BLE communication

This is the code, thank you

if(enbaleTrackpad != 0u)

            {

                        /* Sets up a callback function using sysTick timer isr, the callback function

                        is part of the CySysTickSetCallback API */

                       

//CALL INCREMENT TIMESTAMP CALLBACK ONLY HERE

                        CapSense_dsRam.timestampInterval = 1u;

             /////          // CapSense_dsRam.timestampInterval = 2u;

                        CySysTickStart();

                        CySysTickSetCallback(0u, CapSense_IncrementGestureTimestamp);

                       

                 //////      // CapSense_SetGestureTimestamp(2u);

                       

                       

        /* Start scanning all enabled sensors */

         

                        CapSense_SetupWidget(CapSense_TOUCHPAD0_WDGT_ID);

                        CapSense_Scan();  

                /* Wait for scanning to complete */

        while(CapSense_IsBusy() != 0u)

                {

                }

////IS IT BETTER TO INCREMENT THE TIMESTAMP GESTURE HERE????

               ///////       //  CapSense_IncrementGestureTimestamp ();

                       

                        CapSense_ProcessWidget(CapSense_TOUCHPAD0_WDGT_ID);

    

/* Process the trackpad X,Y and the gestures */

if(CyBle_GattGetBusStatus() == CYBLE_STACK_STATE_FREE)

{

/////////IS IT BETTER TO INCREMENT THE TIMESTAMP GESTURE HERE????

                         //////  // CapSense_SetGestureTimestamp(2u);

                        /////    //CapSense_IncrementGestureTimestamp ();

                           

/* Get the gesture */                 

                gestureID = CapSense_DecodeWidgetGestures(CapSense_TOUCHPAD0_WDGT_ID);

/* Get delta X and delta Y */

                            touchPos[0]=CapSense_TOUCHPAD0_POS_X_DELTA_VALUE;

                            touchPos[1]=CapSense_TOUCHPAD0_POS_Y_DELTA_VALUE;

                           

                            touch=CapSense_IsWidgetActive(CapSense_TOUCHPAD0_WDGT_ID);

/* simulate a mouse  */

                           

                           

                            if ((touch != 0u)||(gestureID != 0u))

                { 

                    SimulateMouse(gestureID);

                }

                else

                {

                    touchPos[0] = 0u;

                    touchPos[1] = 0u;

                    SimulateMouse(gestureID);

                }

0 Likes
1 Solution
BragadeeshV
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hi dabo_4430311​,

Refer to the CapSense_IncrementGestureTimestamp explanation in the CapSense component datasheet for the different methods of updating the timestamp.

https://www.cypress.com/documentation/component-datasheets/psoc-4-capacitive-sensing-capsense

Since you are registering a periodic callback to update the timestamp using Systick, it is not required to call this func in the application.

Please refer to the CE224820 – PSoC 4 CapSense Slider with Gestures that implements all the three techniques to update timestamp.

https://www.cypress.com/documentation/component-datasheets/psoc-4-capacitive-sensing-capsense

Regards,

Bragadeesh

Regards,
Bragadeesh

View solution in original post

0 Likes
1 Reply
BragadeeshV
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hi dabo_4430311​,

Refer to the CapSense_IncrementGestureTimestamp explanation in the CapSense component datasheet for the different methods of updating the timestamp.

https://www.cypress.com/documentation/component-datasheets/psoc-4-capacitive-sensing-capsense

Since you are registering a periodic callback to update the timestamp using Systick, it is not required to call this func in the application.

Please refer to the CE224820 – PSoC 4 CapSense Slider with Gestures that implements all the three techniques to update timestamp.

https://www.cypress.com/documentation/component-datasheets/psoc-4-capacitive-sensing-capsense

Regards,

Bragadeesh

Regards,
Bragadeesh
0 Likes