-
• #27
:) The custom font is slower because Espruino has to unpack it from RAM - in Espruino things sometimes aren't stored in one block of memory to work around fragmentation - so for every access it has to check.
When using the built-in font it's using very specific, fast code to access flash.
Did you try the new firmware I linked? That should be a lot faster.
Actually thinking about it, it seems that
atob
doesn't create a flat string when it could do.You might get faster rendering by doing:
var font = E.toString(atob("AAAAAPoAwADAAFhw2HDQAGSS/5JMAGCW+DzSDAxSolIMEsAAPEKBAIFCPABIMOAwSAAQEHwQEAABBgAQEBAQAAIAAwwwwAB8ipKifABA/gBChoqSYgCEkrLSjAAYKEj+CADkoqKinAA8UpKSDACAgI6wwABskpKSbABgkpKUeAAiAAEmABAoRAAoKCgoKABEKBAAQIqQYAA8WqW9RDgOOMg4DgD+kpKSbAB8goKCRAD+goJEOAD+kpKCAP6QkIAAfIKCklwA/hAQEP4A/gAMAgIC/AD+EChEggD+AgICAP5AIED+AP7AMAz+AHyCgoJ8AP6QkJBgAHyChoN8AP6QmJRiAGSSkpJMAICA/oCAAPwCAgL8AOAYBhjgAPAOMA7wAMYoECjGAMAgHiDAAI6SosIA/4EAwDAMAwCB/wBAgEAAAQEBAQEBEn6SggQABCoqHgD+IiIcABwiIhQAHCIi/gAcKioYACB+oIAAGCUlPgD+ICAeAL4AAQG+AP4IFCIA/AIAPiAeIB4APiAgHgAcIiIcAD8kJBgAGCQkPwA+ECAgABIqKiQAIPwiADwCAjwAIBgGGCAAOAYIBjgAIhQIFCIAIRkGGCAAJioyIgAQboEA5wCBbhAAQIDAQIAAPFqlpUI8cPh8+HAAcDhwACBg/mAgAAgM/gwIABA4fBAQABAQfDgQAHxERER8AHxE9CRcAHxUbFR8AP58OBAAEDh8/gACAAIAAgB8fHx8fAD+/gD+/gACilIiAgACIlKKAgA+Yu5iPgACAgICAgAGBgYGBgAODg4ODgAeHh4eHgA+Pj4+PgB+fn5+fgD+/v7+/gD+/v7+/gAAAAAA/gD+/gD+/v4A/v7+/gD+/v7+/gA4OHz+/gAMDPBAIACeADhE/kQIABJ8koIEAEQ4KDhEAKhoPmioACh8qqqCAARSqpRAAJCkqKSQAP6CupL+ABKqqqp6ABAoVChEADh8fHw4ADhUbFQ4AP6Cpor+ABAYHBgQAGCQkGAAIiL6IiIASJioSACIqKhQACBAgAB/BAQIfABgkP6A/gAwMAAAAAAASPgIADlFRUU5AEQoVCgQAOgWKl+CAOgQKVONAKj4BgofAAYJUQIADpRkFA4ADhRklA4ADlSUVA4ATpSUVI4AjjjIOI4ADlS0VA4APkj+kpIAeISFh0gAPqpqKiIAPmqqKiIAPmqqaiIAPqoqqiIAon4iACJ+ogBivmIAYj5iABB+UkI8AH6QiES+AByiYiIcABwiYqIcAAxSklIMAEySklKMALxCQkK8ACIUCBQiAD5DXWE+ADyCQgI8ADwCQoI8ABxCgkIcALwCAgK8ACAQTpAgAIH/JSQYAH+SkmwABKpqHgAEKmqeAARqql4ARKqqXoCEKiqeAARqql4ATFI8UjQAGCUnJAgAHKpqKhgAHCpqmAAcaqpYAByqKpgAon4CACJ+ggBivkIAYj5CAKRKqhoMAF6QkE6AAAySUgwADBJSjAAMUpJMAEySUowAnCIinAAQEFQQEAA6TFRkuAAcgkIcABxCghwAHEKCXABcAgJcADAKSoo8AIH/FQgAMIoKijwA")); var widths = E.toString(atob("BAIEBgYGBgIEBAYGAwUCBQYDBgYGBgYGBgYCAwQGBAUGBgYGBgUFBgYCBgYFBgYGBgYGBgYGBgYGBgUDBQMEBgYFBQUFBQUFBQIEBQMGBQUFBQUFBAUGBgYGBQQCBAYGBgQGBgYGBgYGBQUGBgYGBgYGBgYGBgYGBgQCAwQFBgYGAgYGBgYGBgYGBgYGBgYGBQYFBQQGBgMEBAYGBgYGBQYGBgYGBgYGBgYGBgQEBAQGBgYGBgYGBgYGBgYGBgYFBQUFBQUFBgYGBQUFBAQEBAYGBQUFBQUGBgUFBQUGBQY=")); Graphics.prototype.setFontDennis8 = function() { this.setFontCustom(font, 32, widths, 8); };
So basically Dennis8, but with
E.toString
aroundatob
. I'd be interested to see what difference that makes?I'll make a note to improve
atob
- there's no reason it shouldn't use flat strings, which would be a lot faster and more efficient -
• #28
timing test
t = getTime(); g.setFontDennis8(); g.drawString(texte,compteur,0); console.log("Draw took ",getTime()-t);
1v92 FIRMWARE
with custom font likesetFontDennis8
: 0,244
with custom font simplified : 0,239
with custom font likesetFontDennis8
+E.toString()
: 0,154
with custom font simplifed +E.toString()
: 0,1551v92 CUSTOM FIRMWARE
with custom font likesetFontDennis8
: 0,106
with custom font simplified : 0,106
with custom font likesetFontDennis8
+E.toString(atob)
+ : 0,094
with custom font simplified +E.toString()
: 0,094therefor best result with:
. custom firmware
.E.toString()
. nothing more with simplified font (only usefull char design) -
• #29
An other issue with the standart 1v92 firmware.
with the quicksetInterval()
orserial1.write()
i'm unable to upload code... upload stall at a point (variable). Have to unplug and plug pico board (1.4b) in bootloader mode and reinstall firmware.with your custom firmware it always upload to board
huge update for me : plug/unplug usb board crash my old macbook Pro (17 mid 2009) -> 1 time/4 unplug :/thanks
é.
-
• #30
Great! That's a definite improvement - and I'll see about trying to build the
E.toString
intoatob
.Very strange about your crash during upload though - I don't know what would have changed. If you're not doing 'save on send' then absolutely everything you do when you upload should get erased just by unplugging and replugging.
-
• #31
The crash is not an espruino issue, it's an usb issue, it produce too sometime with arduino...
Last week i have to update firmware and install my code on 8 Picos.... I've got crashs (with automatic reboot and message) 4 time 😗. For simple and repetitive task, reboot had made it long and stressfull.For the upload problem, i don't know, i've discovered the
reset()
instruction and it seems to resolve the problem (when code use shortsetInterval()
). You're probably right, i just change my process for upload with in first step, areset()
. Have to check -
• #32
The Web IDE should do a
reset()
automatically before the upload (unless it was turned off in the options?), so I doubt that's you problem.However if you have a very short
setInterval
outside of a function then that would take effect immediately and could keep the Pico too busy to properly process new data? -
• #33
Wow - this looks great!
found some cheaper flip dots https://hannio.org/en/?s=FlipDot&post_type=product
5x7 FlipDot controller + 5x 1x7 FlipDots for 40€ plus shipping
to bad no controller on stock :(
-
• #34
I've bought it...😎
I'm in vacation til mid august...
I'll try when back home -
• #35
Controller back in stock !!!
and yes @Gordon, it's a long text and it is exactly why i work with Espruino,
. more ram
. a better api for string manipulation (than arduino) = js,
. a small form factor!
. easy to program
:)