CapSense_1_GetSensorCapacitance not working

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

cross mob
lock attach
Attachments are accessible only for community members.
sdkadu
Level 1
Level 1
5 sign-ins First reply posted First question asked

 

I was trying to use the following function to get the capacitance reading:

Raw_padVal[1] = CapSense_1_GetSensorCapacitance(CapSense_1_BUTTON0_WDGT_ID,CapSense_1_BUTTON0_TX0_ID, measurementStatusPtr);

However, I was got stucked in infinite loop 

sdkadu_0-1625277749513.png

I also try to use this pointer to get the capacitance Raw_padVal[1]= CapSense_1_BUTTON0_PTR2SNS_CP_VALUE[0]; But I get the following error:

sdkadu_1-1625277889280.png

 

I have attached the project to this post, any help will be greatly appreciated 

0 Likes
1 Solution
Hari
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi @sdkadu 

 

The issue is caused since you are passing the pointer without assigning it to a memory location. Can you please declare measurementStatusPtr as a normal variable and pass the address to the function. 

 

Line #15 would change to 

CapSense_1_TST_MEASUREMENT_STATUS_ENUM measurementStatusPtr;

 

and line #73 would change to 

Raw_padVal[2] = CapSense_1_GetSensorCapacitance(CapSense_1_BUTTON0_WDGT_ID,CapSense_1_BUTTON0_TX0_ID, &measurementStatusPtr);

 

Can you please try this out and let us know if it works?

 

Best regards, 
Hari

View solution in original post

1 Reply
Hari
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi @sdkadu 

 

The issue is caused since you are passing the pointer without assigning it to a memory location. Can you please declare measurementStatusPtr as a normal variable and pass the address to the function. 

 

Line #15 would change to 

CapSense_1_TST_MEASUREMENT_STATUS_ENUM measurementStatusPtr;

 

and line #73 would change to 

Raw_padVal[2] = CapSense_1_GetSensorCapacitance(CapSense_1_BUTTON0_WDGT_ID,CapSense_1_BUTTON0_TX0_ID, &measurementStatusPtr);

 

Can you please try this out and let us know if it works?

 

Best regards, 
Hari