You are reading a single comment by @ChristianW and its replies. Click here to read the full conversation.
  • @Gordon I'd like to have a method to do a reset "in the field", meaning starting everything new when I have to.

    What is working is calling my reset() method via commandline.
    What does not work is calling it through a handler after a button was pressed.

    The method does this:

      reset: function() {
        console.log('reset');
        if(!Flash.s.write(Flash.NAME, [CONST.LAP_DATA_SIZE], 0, 1 + CONST.LAP_DATA_SIZE * CONST.LAPS_STORAGE)) {
          throw new Error('could not reserve storage');
        }
        Flash.pos = 0;
      },
    

    manual call:

    >Flash.reset()
    reset
    =undefined
    

    through handler:

    reset
    Uncaught Error: Unable to find or create file
     at line 1 col 114
    ...ATA_SIZE*CONST.LAPS_STORAGE))throw new Error('could not reserve stor...
                                          ^
    in function "reset" called from line 1 col 15
    a&&Flash.reset(),Object.keys(this.macs).­forEach(c=>{const d=this.macs[c];...
                               ^
    in function "init" called from line 1 col 122
    ...tons.BTN_MID]&&(Race.init(!0),ErrorLo­g.log=[]),this.objects.forE...
                                      ^
    in function "wakeup" called from line 1 col 16
    a?Power.wakeup():Power.sleep()
                   ^
    in function "onOff" called from line 1 col 37
    ...N?Buttons.onOff(a,b.state==0):Buttons­.event(a,b.state==0)
                                    ^
    in function called from system
    
About

Avatar for ChristianW @ChristianW started