Revision f336542d components/gyro/l3g4200d.cpp

View differences:

components/gyro/l3g4200d.cpp
37 37
  this->setName("l3g4200d");
38 38

  
39 39
  while (!this->shouldTerminate()) {
40
  time += this->period_st;
40
    time += this->period_st;
41 41

  
42 42
    updateSensorData();
43 43
    calcAngular();
......
48 48
      chThdSleepUntil(time);
49 49
    } else {
50 50
      chprintf((BaseSequentialStream*) &global.sercanmux1, "WARNING l3g4200d: Unable to keep track\r\n");
51
  }
51
    }
52 52
  }
53 53
  return RDY_OK;
54 54
}
......
62 62
int32_t
63 63
L3G4200D::
64 64
getAngularRate_udps(const uint8_t axis) {
65
  return uint32_t(this->angularRate[axis]) * this->udpsPerTic;
65
  return int32_t(this->angularRate[axis]) * this->udpsPerTic;
66 66
}
67 67

  
68 68
int32_t
......
160 160
    case L3G4200D::DR_400_HZ: this->period_us =  2500; break;
161 161
    case L3G4200D::DR_800_HZ: this->period_us =  1250; break;
162 162
  }
163
  this->period_st = US2ST(this->period_st);
163
  this->period_st = US2ST(this->period_us);
164
  this->period_ms = this->period_us * 1e-3;
164 165

  
165 166
  // Handle the new full scale
166 167
  switch(config->ctrl1 & L3G4200D::FS_MASK) {

Also available in: Unified diff