cancel
Showing results for 
Search instead for 
Did you mean: 

TouchGFX: snprintf Buffer & Size Undeclared

KMew
Senior III

Hello,

I am running a TouchGFX compiled code and am attempting to display a value from my code onto the LCD screen. I used the Tutorial 2 format for using the Unicode:snprintf function, but I am getting an error.

"TEXTLED_STATUS_SIZE" was not declared in this scope.

"textLED_StatusBuffer" was not declared in this scope.

I have included a screenshot of my TouchGFX Designer properties, showing that the name textLED_Status is correct.

0693W00000VOjLkQAL.png 

Additionally, I have included the snippet of my code:

void Screen1View::UpdateLED(uint32_t value){
	  Unicode::snprintf(textLED_StatusBuffer, TEXTLED_STATUS_SIZE, "%d", value);
	  // Invalidate text area, which will result in it being redrawn in next tick.
	  textLED_Status.invalidate();
}

I ran Tutorial 2 separately and this issue did not occur.

What would cause this?

1 ACCEPTED SOLUTION

Accepted Solutions
KMew
Senior III

I spent an hour trying to debug this then found the source minutes after posting.... :)

In the TouchGFX designer, I did not have the "Use Wildcard Buffer" checkmarked. Did that and it resolved the issue.

0693W00000VOjNWQA1.png

View solution in original post

1 REPLY 1
KMew
Senior III

I spent an hour trying to debug this then found the source minutes after posting.... :)

In the TouchGFX designer, I did not have the "Use Wildcard Buffer" checkmarked. Did that and it resolved the issue.

0693W00000VOjNWQA1.png