avr/prgspace error problem

Hi,

I had similar problems with the lack of avr/pgmspace.h in the MPU6050 code. Don't know if my fixes are legit by I basically just got rid of all uses of program space functions ( PROGMEM, pgm_read_byte(), prog_uchar, etc) and replaced them with regular memory assignments and access calls. I just wanted it to work. Performance was of secondary importance.

There are also several functions that take a parameter argument "useProgMem" where it appears to be a mechanism for not using pgmspace features. Unfortunately, the technique still fails if the entire header is unavailable. There are also few places that continue to use the pgmspace functions and ignore the "useProgMem" option.

There were a few other miscellaneous changes which I can't remember.

I had problems within the loop() code in the MPU6050_DMP6 example. Specifically, the first while-loop that checks the interupt & fifoCount would get stuck. Reading the comments, it seems the author anticipated this problem. I just changed it to:

  // wait for MPU interrupt or extra packet(s) available
  while (!mpuInterrupt && fifoCount < packetSize) {
    if (mpuInterrupt)
      break;

Not elegant but functional. After all the changes, my hacked version of the motion fusion example works great with my Sparkfun MPU9150 breakout (SparkFun 9DoF IMU Breakout - ICM-20948 (Qwiic) - SEN-15335 - SparkFun Electronics) on my Arduino Due. (The unaltered code already worked fine with my Uno.)

Hope this helps,

-Rob