Skip to main content
KMew
Senior III
November 2, 2022
Solved

TouchGFX: snprintf Buffer & Size Undeclared

  • November 2, 2022
  • 1 reply
  • 1856 views

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?

This topic has been closed for replies.
Best answer by KMew

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

1 reply

KMew
KMewAuthorBest answer
Senior III
November 2, 2022

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