• I'm trying to get https://www.espruino.com/MPU6050 working on my Pixl.js and I'm running into memory issues when doing the MPU6050_DMP example. Looking at https://www.espruino.com/modules/MPU6050­_DMP.js and the minified version https://www.espruino.com/modules/MPU6050­_DMP.min.js it seems that I'll need to cut down on the unnecessary libraries included in the firmware.

    I've removed many of the libraries and only left BLUETOOTH and PIXLJS and have reduced the size of the DFU zip to just 312k but it looks like I also would need to adjust the variables section to actually make use of the freed space.

    How do I calculate the actual amount of variables I can set?

    process.memory() gives me this:

    >process.memory()
    ={ free: 1733, usage: 767, total: 2500, history: 8,
      gc: 0, gctime: 4.30297851562, blocksize: 16, "stackEndAddress": 536929600, flash_start: 0,
      "flash_binary_end": 444468, "flash_code_start": 446464, flash_length: 524288 }
    

    so does that mean 524288 - 446464 = 77824 variables I can use for the variables section? (it was originally set to 2500) or should I just do a trial and error to find the thresholds?

About

Avatar for parasquid @parasquid started