HELP with functions Jeff Rowberg MPU6050

Hi,

I'm going through Jeff Rowbergs code for the MPU6050 and because of my limited C knowledge I'm having a problem following one particular part, because the libraries are large I've just posted a snip it showing the relative parts to the question. I know some of you will grimace at this but please bare with me.

PART 1

if (writeProgMemoryBlock(dmpMemory, MPU6050_DMP_CODE_SIZE)) {
        DEBUG_PRINTLN(F("Success! DMP code written and verified."));

So in the code above the way understand is that, if function "writeProgMemoryBlock" returns true, do this x,y,z...

When I look at the MPU6050.cpp file and find the function "writeProgMemoryBlock" I get :

PART 2

bool MPU6050::writeProgMemoryBlock(const uint8_t *data, uint16_t dataSize, uint8_t bank, uint8_t address, bool verify) {
    return writeMemoryBlock(data, dataSize, bank, address, verify, true);

Great it returns a Boolean but..... How is the function called when not enough arguments are passed to it initially in PART 1.

I hope this makes sense. The question is a general programming question. If any more info needed please ask.

BR D

How is the function called when not enough arguments are passed to it initially in PART 1.

Defaults specified elsewhere (like the header file)?

Hi AWOL, Can you elaborate a little more for me?

Do you have the header file for the library? (I don't) What does the class "MPU6050" look like, specifically the method "writeProgMemoryBlock" ?

I’ve attached the MPU6050.h, MPU6050_6Axis_MotionApps20.h and the MPU6050.cpp files

I have looked for what I thought would be some sort default values in the MPU6050.h, Not really sure what I am looking for though.

MPU6050.h (43.3 KB)

MPU6050_6Axis_MotionApps20.h (40.7 KB)

MPU6050.cpp (126 KB)

  bool writeProgMemoryBlock(const uint8_t *data, uint16_t dataSize, uint8_t bank=0, uint8_t address=0, bool verify=true);

Defaults

        // MEM_R_W register
        uint8_t readMemoryByte();
        void writeMemoryByte(uint8_t data);
        void readMemoryBlock(uint8_t *data, uint16_t dataSize, uint8_t bank=0, uint8_t address=0);
        bool writeMemoryBlock(const uint8_t *data, uint16_t dataSize, uint8_t bank=0, uint8_t address=0, bool verify=true, bool useProgMem=false);
        bool writeProgMemoryBlock(const uint8_t *data, uint16_t dataSize, uint8_t bank=0, uint8_t address=0, bool verify=true);

Exactly...... I spent 4 hours trying to figure this out....... And there is !!! I never searched the header for the full function name.... Only the arguments. Learn't much .

Thanks