You are reading a single comment by @krishna and its replies. Click here to read the full conversation.
  • No problem!

    I don't know if this is helpful, but Espruino has NVRAM too. You can use the following functions (at least on the original Espruino board) to access it:

    function nvaddr(n) {
      if (n>=0 && n<10) return 0x40006C04+n*4;
      if (n>=10 && n<42) return 0x40006C40+(n-10)*4;
      return 0;
    }
    
    // 16 bits, a=0..41
    function nvread16(a) {
      return peek16(nvaddr(a));
    }
    
    // 16 bits, a=0..41
    function nvwrite16(a, value) {
      return poke16(nvaddr(a), value);
    }
    

    For instance:

    for (var i=0;i<42;i++) nvwrite16(i, i*100)
    
    // then do a hard reset
    
    for (var i=0;i<42;i++) console.log(nvread16(i))
    0
    100
    200
    300
    ...
    4000
    4100
    

    Obviously you still need a battery to be connected to the board for that though.

    (and yes, moving the topic now)

About

Avatar for krishna @krishna started