You are reading a single comment by @d3nd3-o0 and its replies. Click here to read the full conversation.
  • It seems that just invoking the FPU and not clearing the interrupt, the nRF52 chip couldn't sleep.

    This one seems particularly common, have we covered that alreadY? The code above covers it. And we are doing float arithmetic with getBattery .. hmm

  • This one seems particularly common, have we covered that alreadY? The code above covers it. And we are doing float arithmetic with getBattery .. hmm

    Espruino does not use HW floating point, javascript uses double type which is not what the FPU can do so this FPU fix was not there as it was not needed. If you still have older firmware you could check (and clear) FPU state and pending IRQ with https://gist.github.com/fanoush/1efde25636cd62a82a857cf8b6a5c86f , see end of it, just paste

    var fpu = (function(){
      var bin=atob("CErS+AQxWwYK1fHuEDoj8J8D4e4QOvHuEDpAI8L4hDFwRwC/AOEA4PHuEApwRwAAAkvT+AQBwPOAEHBHAOEA4A==");
      return {
        getFPSCR:E.nativeCall(41, "int()", bin),
        getPendingFPUIRQ:E.nativeCall(49, "int()", bin),
        clearFPUIRQFlags:E.nativeCall(1, "void()", bin),
      };
    })()
    

    and then call fpu.getPendingFPUIRQ() to get the pending IRQ flag.

    Anyway having the FPU fix there makes InlineC FPU hacks a bit easier.

About

Avatar for d3nd3-o0 @d3nd3-o0 started