Closed jpcurti closed 6 months ago
The maximum data payload for a data frame is 248 bytes (according to the T5L_TA instruction set): . From the TJC module, the data sent to the display is :
self.byte(self.cmd_draw_text) # 1 byte
self.word(x) # 2 bytes
self.word(y) # 2 bytes
self.byte(0x00) # font # 1 byte
self.byte(0x02 | (show_background * 0x40)) # mode (bshow) # 1 byte
self.byte(size) # size # 1 byte
self.word(font_color) # 2 bytes
self.word(background_color) # 2 bytes
self.string(string) # n bytes
This means that the string
sent to the draw_string
method should have a max length n of 248 - 12 = 238 bytes a.k.a a 238 char string would be the limit.
The crash, however, happens with the string "CE3V3SE_customizable-box-psu-power-adapter-holder_20240505-36-1c54hxf.gcode", which is 75 byte long. What can be wrong here?
Solution: Check the maximum byte number that can be sent when writing text and truncate the string to it.
As anything bigger than 40 char cant be displayed in the screen size anyways, I will truncate the string to 40 bytes and call it a day.
Wide names causes a crash on the file selection menu
only recoverable after a firmware restart: