Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Kiran Shila
    @kiranshila
    That would be javascript yes
    Mark Becker
    @MaBecker
    there is no arguments[] like in c just do
    foo = (a){return ++a};
    this is a very nice place for lookup syntax https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Functions
    Kiran Shila
    @kiranshila
    There literally is
    >((function(){return arguments[0];}))(5)        
    =5
    Mark Becker
    @MaBecker
    Cool, never used it this way 😉
    The first example is a bug in the Espruino's implementation, but I can't seem to find where in the code it is defined such that I can fix it
    Mark Becker
    @MaBecker
    Not sure if this Is implemented in Espruino?
    Kiran Shila
    @kiranshila
    Those examples are from espruino
    Mark Becker
    @MaBecker
    Ok, so start searching in folder src
    Kiran Shila
    @kiranshila
    🤦 Yes I know that. My question is of course which file
    Kiran Shila
    @kiranshila
    Right, too bad argument is a pretty generic term and there are 200 instances of the word argument in the project
    Mark Becker
    @MaBecker
    you found it 👍🏻
    jeffmer
    @jeffmer
    HI Mark, is this the right place to discuss lcd_unbuf_sspi?
    abhigkar
    @abhigkar
    @MaBecker, I have a question about lcd unbuff. I have 128x64 oled (mono) display probably SH1106, but not sure. it worked with some custom Jsvascript oled module here. I want to have scrolling feature and in my current module there is a performance issue when scroll
    is it possible to have get unbuff lcd done for mono colored lcd?
    do you have an example JS code where i can see how to use lcd_spi_unbuf class from JavaScript?
    fanoush
    @fanoush
    despite generic name that driver is not suitable for oled but mostly only for ST7735 or ST7789 displays, ones that can update rectangular window in 16bit color
    see implementation https://github.com/espruino/Espruino/blob/master/libs/graphics/lcd_spi_unbuf.c#L132 disp_spi_transfer_addrwin and lcd_spi_unbuf_setPixel, lcd_spi_unbuf_fillRect methods
    abhigkar
    @abhigkar
    hmm. that explains why it wasn't working. I want to have smooth scrolling screen, that I know is working on watch stock firmware. But somehow I am not able to get it working on Espruino JavaScript code. I am using buffer to fill the data and flip to write to OLED, this is slow. It is also very slow when I use Espruino graphics scroll() function. So if I use DMA to write directly to OLED?
    I also see that SH1106 also supports hardware scrolling, but it is also not working...
    There is an Adafruit library that does but it is C
    I also saw @fanoush is using some Native C code for DMA but I think it is for colored display
    fanoush
    @fanoush
    firmware probably does hardware scrolling, you change beginning of the frame and draw into hidden areas and scroll that into view, not sure that DMA can make any difference, the oled is very small and only B/W so there is not a lot of data to push
    fanoush
    @fanoush
    also DMA won't help you if you need to send lot of small transfers (command+data), the SSD1306 128x32 oled in DS-D6 can do linear mode and send whole screen as one data fill, that may work for scrolling, however the 128x64 one that is e.g. in HX03W is not SSD1306 and screen is updated as several separate pages, so that cannot be done as one quick DMA transfer
    abhigkar
    @abhigkar
    hmm t quickly checked Espruino Scroll function but OLED is no performing well like in original watch app
    wondering how developer of the original app managed the smooth scroll...
    any way, on the other note my STLink V2 started working again. Not sure what happened but it can now connect to the watch...
    I have ordered another one, just waiting for that
    Mark Becker
    @MaBecker
    @abhigkar Hi, happy that fanoush gave you a propper answer ;-)
    lcd_spi_unbuf can also be used for a ILI9431
    abhigkar
    @abhigkar
    thanks @MaBecker @fanoush
    Ákos Lukács
    @AkosLukacs
    Hi, could you check what Math.random() returns right after reset?
    On ESP32 2v04 it seems to always return =0.93255273901
    On Puck, it seems to be indeed random (at least by the time I can connect to it)
    Just reset(1), saved var bla = Math.random(); to flash, and reset the device
    Mark Becker
    @MaBecker
    >Math.random()
    =0.93255273901
    >reset(1)
    Erasing saved code.
    Done!
    =undefined
    WARNING: gap set scan error code = 103
    WARNING: set rssi scan not implemeted yet
     ____                 _
    |  __|___ ___ ___ _ _|_|___ ___
    |  __|_ -| . |  _| | | |   | . |
    |____|___|  _|_| |___|_|_|_|___|
             |_| espruino.com
     2v07.24 (c) 2019 G.Williams
    Espruino is Open Source. Our work is supported
    only by sales of official boards and donations:
    http://espruino.com/Donate
    >Math.random()
    =0.70772355874
    Ákos Lukács
    @AkosLukacs
    Thanks, so that's Espressif's IDF (or the lack of proper random seed). I got the same two numbers on ESP32 and ESP8266 after reboots
    Mark Becker
    @MaBecker
    This message was deleted
    Ákos Lukács
    @AkosLukacs
    Nordic and STM sdks seem to initialize with a random seed. Or use a real random generator, don't know.
    My esp32 mqtt disconnect issue was due to this: the big MQTT library creates a "random" client id. But wasn't r
    Random at all with esp32. So two ESP32 kept kicking out each other :)
    Mark Becker
    @MaBecker
    Wow - that's bad - lucky you found it
    Mark Becker
    @MaBecker
    AFAIK tinyMQTT does not create a client id.
    Mark Becker
    @MaBecker
    OK - Yes it does - but this is not Math.random(), getSerial() is unique for every board.
    lucky me
    Ákos Lukács
    @AkosLukacs
    yes yes
    Mark Becker
    @MaBecker
    ;-)
    Ollie Phillips
    @olliephillips

    OK - Yes it does - but this is not Math.random(), getSerial() is unique for every board.

    ;)