/* Checks if there is new accel/gyro data available for read. In case of ver 0.3.0 and older of the PIC firmware the state of the PIC_INT_WAKE needs to be read to determinte if the IMU interrupt is valid.  */
bool IMU_isDataReadyFlag(void)
/* Checks if there is new accel/gyro data available for read. In case of ver 0.3.0 and older of the PIC firmware the state of the PIC_INT_WAKE needs to be read to determinte if the IMU interrupt is valid.  */
bool IMU_isDataReadyFlag(void)
{
   bool ready;
   unsigned int pin;
   if( IMU_state != IMU_STATE_READY ){
      return false;
   }
   ready = dataReady;
   if( BOARD_picIsLegacyIntCtrl() ) {
      pin = GPIO_PinInGet( BOARD_PIC_INT_WAKE_PORT, BOARD_PIC_INT_WAKE_PIN );
      if( pin == 0 ) {
         ready = true;
      }
   }
   return ready;
}