You are reading a single comment by @fanoush 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/1efde256­36cd62a82a857cf8b6a5c86f , see end of it, just paste

    var fpu = (function(){
      var bin=atob("CErS+AQxWwYK1fHuEDoj8J8D4e4QOv­HuEDpAI8L4hDFwRwC/AOEA4PHuEApwRwAAAkvT+A­QBwPOAEHBHAOEA4A==");
      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 fanoush @fanoush started