pkourany / MPU6050

MPU6050 IMU Library adapted for Spark
Other
3 stars 6 forks source link

MPU6050_DMP6 does not currently compile #1

Closed giantmolecules closed 9 years ago

giantmolecules commented 9 years ago

I was very happy to come across your ported code and the examples of its use:

http://vimeo.com/88732224

But as of now, the code will not compile (Spark Firmware v0.3.4). Here's the error report:

In file included from ../inc/spark_wiring.h:29:0, from ../inc/application.h:29, from I2Cdev.h:49, from I2Cdev.cpp:46: ../../core-common-lib/SPARK_Firmware_Driver/inc/config.h:12:2: warning: #warning "Defaulting to Release Build" [-Wcpp]

warning "Defaulting to Release Build"

^ In file included from ../inc/spark_wiring.h:29:0, from ../inc/application.h:29, from I2Cdev.h:49, from MPU6050.h:40, from MPU6050.cpp:37: ../../core-common-lib/SPARK_Firmware_Driver/inc/config.h:12:2: warning: #warning "Defaulting to Release Build" [-Wcpp]

warning "Defaulting to Release Build"

^ MPU6050.cpp: In member function 'bool MPU6050::writeMemoryBlock(const uint8t, uint16_t, uint8_t, uint8_t, bool, bool)': MPU6050.cpp:2988:88: warning: 'progBuffer' may be used uninitialized in this function [-Wmaybe-uninitialized] for (j = 0; j < chunkSize; j++) progBuffer[j] = pgm_read_byte(data + i + j); ^ MPU6050.cpp: In member function 'bool MPU6050::writeDMPConfigurationSet(const uint8t, uint16_t, bool)': MPU6050.cpp:3076:101: warning: 'progBuffer' may be used uninitialized in this function [-Wmaybe-uninitialized] if (sizeof(progBuffer) < length) progBuffer = (uint8_t *)realloc(progBuffer, length); ^ In file included from ../inc/spark_wiring.h:29:0, from ../inc/application.h:29, from mpu_6050_dmp6.cpp:2: ../../core-common-lib/SPARK_Firmware_Driver/inc/config.h:12:2: warning: #warning "Defaulting to Release Build" [-Wcpp]

warning "Defaulting to Release Build"

^ mpu_6050_dmp6.cpp:6:1: error: expected unqualified-id before 'else' else if (mpuIntStatus & 0x02); ^ In file included from mpu_6050_dmp6.cpp:47:0: MPU6050_6Axis_MotionApps20.h: In member function 'uint8_t MPU6050::dmpReadAndProcessFIFOPacket(uint8_t, uint8t)': MPU6050_6AxisMotionApps20.h:722:41: warning: value computed is not used [-Wunused-value] if (processed != 0) processed++; ^ make: * [mpu_6050_dmp6.o] Error 1

pkourany commented 9 years ago

@giantmolecules, oddly, someone else took my library and posted it so I can't change it in the IDE. I just pulled down all the files and the DMP6 example into a single directory and compiled it using Spark CLI and it compiled just fine. I highly recommend using CLI or Spark DEV for developing.

Cheers!

Paul

giantmolecules commented 9 years ago

@pkourany-- thanks for the speedy reply! i've only started using spark's cli and haven't tried compiling with it. so i did the same thing, gathered all the files in one directory, compiled and flashed. no problem! I'm not however getting any serial data. No failed connection messages, etc. btw, thanks for porting this!

giantmolecules commented 9 years ago

haha...it wants a serial character to begin... ;P