Avatar for Gordon

Gordon

Member since Sep 2013 • Last active Jun 2017

Most recent activity

  • in Interfacing
    Avatar for Gordon

    Great! That's a definite improvement - and I'll see about trying to build the E.toString into atob.

    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.

  • in Puck.js
    Avatar for Gordon

    Also, 2 batteries in one day?? I'm really surprised.

    They're supposed to be 200mAh batteries at least, and usually even if you're doing a bunch of stuff with the microcontroller it'll only draw 4mA - so you'd hope to get 50 hours out of it.

    If you turned the LEDs on the power draw would go right up, but still - it takes commitment to drain them so quickly :)

  • in Puck.js
    Avatar for Gordon

    Great! Glad it's working!

    Saying that, the new firmware has seemed to stop the 3mA current draw when sleeping.

    The new firmware will still break if you don't have the delay though. I've filed a bug with Nordic in the hope that they'll have some workaround - it does seem to be an issue with the Nordic SDK rather than Espruino itself.

  • in Interfacing
    Avatar for Gordon

    :) 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("AAAAAPoAwADAAFhw2HDQAGS­S/5JMAGCW+DzSDAxSolIMEsAAPEKBAIFCPABIMOA­wSAAQEHwQEAABBgAQEBAQAAIAAwwwwAB8ipKifAB­A/gBChoqSYgCEkrLSjAAYKEj+CADkoqKinAA8UpK­SDACAgI6wwABskpKSbABgkpKUeAAiAAEmABAoRAA­oKCgoKABEKBAAQIqQYAA8WqW9RDgOOMg4DgD+kpK­SbAB8goKCRAD+goJEOAD+kpKCAP6QkIAAfIKCklw­A/hAQEP4A/gAMAgIC/AD+EChEggD+AgICAP5AIED­+AP7AMAz+AHyCgoJ8AP6QkJBgAHyChoN8AP6QmJR­iAGSSkpJMAICA/oCAAPwCAgL8AOAYBhjgAPAOMA7­wAMYoEC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J+ggBivkIAYj5CAKR­KqhoMAF6QkE6AAAySUgwADBJSjAAMUpJMAEySUow­AnCIinAAQEFQQEAA6TFRkuAAcgkIcABxCghwAHEK­CXABcAgJcADAKSoo8AIH/FQgAMIoKijwA"));
    var widths = E.toString(atob("BAIEBgYGBgIEBAYGAwUCBQY­DBgYGBgYGBgYCAwQGBAUGBgYGBgUFBgYCBgYFBgY­GBgYGBgYGBgYGBgUDBQMEBgYFBQUFBQUFBQIEBQM­GBQUFBQUFBAUGBgYGBQQCBAYGBgQGBgYGBgYGBQU­GBgYGBgYGBgYGBgYGBgQCAwQFBgYGAgYGBgYGBgY­GBgYGBgYGBQYFBQQGBgMEBAYGBgYGBQYGBgYGBgY­GBgYGBgQEBAQGBgYGBgYGBgYGBgYGBgYFBQUFBQU­FBgYGBQUFBAQEBAYGBQUFBQUGBgUFBQUGBQY="))­;
    
      Graphics.prototype.setFontDennis8 = function() {
        this.setFontCustom(font, 32, widths, 8);
      };
    

    So basically Dennis8, but with E.toString around atob. 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

  • in Puck.js
    Avatar for Gordon

    By the way, just to confuse matters: The UART needs the high speed clock on, which kills power consumption - so the act of actually having the UART connected at startup will affect the power draw all by itself :(

  • in Puck.js
    Avatar for Gordon

    Weird... Error 15 is 'FORBIDDEN'!

    NRF_ERROR_INVALID_STATE is error 8 - I've just been adding text versions of the errors.

    At least you're getting something via serial now - that should hopefully help things along quite a lot. Any luck with the NRF.sleep with a shorter interval on it? Maybe even just 100ms?

  • in JavaScript
    Avatar for Gordon

    I've just pulled this into the main repository (thanks @Stephen-!). Hopefully it'll go live in a day or two.

    Sorry it's taken so long to sort this one out.

  • in General
    Avatar for Gordon

    Wow, amazing - thanks! To be honest it's unlikely to teach you much more about Espruino than you already know, but hopefully there will be some fun projects in it :)

  • in Interfacing
    Avatar for Gordon

    Aha! Yes, drawing a small novel on to your 7x7 LCD screen would definitely slow things down :)

    It is the actual drawing of the characters to the bitmap that takes a while - I don't believe I ever skipped drawing characters if they were offscreen, because I thought that would be quite rare.

    To speed it up, I'd try and split it into smaller chunks. To be honest even calling stringWidth on that amount of characters each frame will be making things slightly slower than they need to be.

    OR I just fixed it, so if you use one of the cutting edge build at http://www.espruino.com/binaries/travis/­2cdc51943388fe3d1944936bf02ad7fae9e0258c­ it'll be a lot faster.

  • in Pico / Wifi / Original Espruino
    Avatar for Gordon

    Was content-length required in the end? Or was it just the URL that @dave_irvine spotted?

Actions