diff --git a/src/MPU6050.cpp b/src/MPU6050.cpp index 9dffd21..8b817c7 100644 --- a/src/MPU6050.cpp +++ b/src/MPU6050.cpp @@ -3140,18 +3140,17 @@ bool MPU6050_Base::writeMemoryBlock(const uint8_t *data, uint16_t dataSize, uint setMemoryStartAddress(address); I2Cdev::readBytes(devAddr, MPU6050_RA_MEM_R_W, chunkSize, verifyBuffer, I2Cdev::readTimeout, wireObj); if (memcmp(progBuffer, verifyBuffer, chunkSize) != 0) { -#ifdef DEBUG - Serial.print("Block write verification error, bank "); - Serial.print(bank, DEC); - Serial.print(", address "); - Serial.print(address, DEC); - Serial.print("!\nExpected:"); - for (j = 0; j < chunkSize; j++) { - Serial.print(" 0x"); - if (progBuffer[j] < 16) Serial.print("0"); - Serial.print(progBuffer[j], HEX); - } - Serial.print("\nReceived:"); + /*Serial.print("Block write verification error, bank "); + Serial.print(bank, DEC); + Serial.print(", address "); + Serial.print(address, DEC); + Serial.print("!\nExpected:"); + for (j = 0; j < chunkSize; j++) { + Serial.print(" 0x"); + if (progBuffer[j] < 16) Serial.print("0"); + Serial.print(progBuffer[j], HEX); + } + Serial.print("\nReceived:"); for (uint8_t j = 0; j < chunkSize; j++) { Serial.print(" 0x"); if (verifyBuffer[i + j] < 16) Serial.print("0"); @@ -3403,4 +3402,4 @@ void MPU6050_Base::PrintActiveOffsets() { Serial.print((float)offsets[3], 5); Serial.print(",\t"); Serial.print((float)offsets[4], 5); Serial.print(",\t"); Serial.print((float)offsets[5], 5); Serial.print("\n\n"); -} +} \ No newline at end of file diff --git a/src/MPU6050.h b/src/MPU6050.h index 7cbbb9d..041963e 100644 --- a/src/MPU6050.h +++ b/src/MPU6050.h @@ -849,4 +849,4 @@ class MPU6050_Base { typedef MPU6050_Base MPU6050; #endif -#endif /* _MPU6050_H_ */ +#endif /* _MPU6050_H_ */ \ No newline at end of file diff --git a/src/MPU6050_6Axis_MotionApps20.cpp b/src/MPU6050_6Axis_MotionApps20.cpp index 3a89674..913650f 100644 --- a/src/MPU6050_6Axis_MotionApps20.cpp +++ b/src/MPU6050_6Axis_MotionApps20.cpp @@ -613,4 +613,4 @@ uint16_t MPU6050_6Axis_MotionApps20::dmpGetFIFOPacketSize() { uint8_t MPU6050_6Axis_MotionApps20::dmpGetCurrentFIFOPacket(uint8_t *data) { // overflow proof return(GetCurrentFIFOPacket(data, dmpPacketSize)); -} +} \ No newline at end of file diff --git a/src/MPU6050_6Axis_MotionApps20.h b/src/MPU6050_6Axis_MotionApps20.h index 0dc9379..3da7070 100644 --- a/src/MPU6050_6Axis_MotionApps20.h +++ b/src/MPU6050_6Axis_MotionApps20.h @@ -150,4 +150,4 @@ class MPU6050_6Axis_MotionApps20 : public MPU6050_Base { typedef MPU6050_6Axis_MotionApps20 MPU6050; -#endif /* _MPU6050_6AXIS_MOTIONAPPS20_H_ */ +#endif /* _MPU6050_6AXIS_MOTIONAPPS20_H_ */ \ No newline at end of file diff --git a/src/MPU6050_6Axis_MotionApps612.cpp b/src/MPU6050_6Axis_MotionApps612.cpp index 653a9e5..4a60436 100644 --- a/src/MPU6050_6Axis_MotionApps612.cpp +++ b/src/MPU6050_6Axis_MotionApps612.cpp @@ -339,14 +339,9 @@ const unsigned char dmpMemory[MPU6050_DMP_CODE_SIZE] PROGMEM = { 0xA6, 0xD9, 0x00, 0xD8, 0xF1, 0xFF, }; -// this divisor is pre configured into the above image and can't be modified at this time. -#ifndef MPU6050_DMP_FIFO_RATE_DIVISOR -#define MPU6050_DMP_FIFO_RATE_DIVISOR 0x01 // The New instance of the Firmware has this as the default -#endif - // this is the most basic initialization I can create. with the intent that we access the register bytes as few times as needed to get the job done. // for detailed descriptins of all registers and there purpose google "MPU-6000/MPU-6050 Register Map and Descriptions" -uint8_t MPU6050::dmpInitialize(uint8_t rateDivisor = 0x04, uint8_t mpuAddr = 0x68) { // Lets get it over with fast Write everything once and set it up necely +uint8_t MPU6050::dmpInitialize(uint8_t rateDivisor, uint8_t mpuAddr) { // Lets get it over with fast Write everything once and set it up necely uint8_t val; uint16_t ival; // Reset procedure per instructions in the "MPU-6000/MPU-6050 Register Map and Descriptions" page 41 diff --git a/src/MPU6050_6Axis_MotionApps612.h b/src/MPU6050_6Axis_MotionApps612.h index 5b24bd8..a1b9526 100644 --- a/src/MPU6050_6Axis_MotionApps612.h +++ b/src/MPU6050_6Axis_MotionApps612.h @@ -43,6 +43,11 @@ THE SOFTWARE. #include "MPU6050.h" +// this divisor is pre configured into the above image and can't be modified at this time. +#ifndef MPU6050_DMP_FIFO_RATE_DIVISOR +#define MPU6050_DMP_FIFO_RATE_DIVISOR 0x01 // The New instance of the Firmware has this as the default +#endif + class MPU6050_6Axis_MotionApps612 : public MPU6050_Base { public: MPU6050_6Axis_MotionApps612(uint8_t address=MPU6050_DEFAULT_ADDRESS, void *wireObj=0) : MPU6050_Base(address, wireObj) { } diff --git a/src/MPU6050_9Axis_MotionApps41.cpp b/src/MPU6050_9Axis_MotionApps41.cpp index d85d74a..a6ca5ac 100644 --- a/src/MPU6050_9Axis_MotionApps41.cpp +++ b/src/MPU6050_9Axis_MotionApps41.cpp @@ -884,4 +884,4 @@ uint8_t MPU6050_9Axis_MotionApps41::dmpReadAndProcessFIFOPacket(uint8_t numPacke // void MPU6050_9Axis_MotionApps41::dmpOverrideQuaternion(long *q); uint16_t MPU6050_9Axis_MotionApps41::dmpGetFIFOPacketSize() { return dmpPacketSize; -} +} \ No newline at end of file diff --git a/src/MPU6050_9Axis_MotionApps41.h b/src/MPU6050_9Axis_MotionApps41.h index 6a65b16..f9569e9 100644 --- a/src/MPU6050_9Axis_MotionApps41.h +++ b/src/MPU6050_9Axis_MotionApps41.h @@ -47,7 +47,7 @@ class MPU6050_9Axis_MotionApps41 : public MPU6050_Base { public: MPU6050_9Axis_MotionApps41(uint8_t address=MPU6050_DEFAULT_ADDRESS, void *wireObj=0) : MPU6050_Base(address, wireObj) { } - uint8_t dmpInitialize(uint8_t rateDivisor = MPU6050_DMP_FIFO_RATE_DIVISOR, uint8_t mpuAddr = 0x68); + uint8_t dmpInitialize(); bool dmpPacketAvailable(); uint8_t dmpSetFIFORate(uint8_t fifoRate); @@ -150,4 +150,4 @@ class MPU6050_9Axis_MotionApps41 : public MPU6050_Base { typedef MPU6050_9Axis_MotionApps41 MPU6050; -#endif /* _MPU6050_6AXIS_MOTIONAPPS41_H_ */ +#endif /* _MPU6050_6AXIS_MOTIONAPPS41_H_ */ \ No newline at end of file