Skip to content

Commit

Permalink
Switch AVR libc _delay_ms usage to Arduino delay function for better …
Browse files Browse the repository at this point in the history
…compatibility with non-AVR boards.
  • Loading branch information
tdicola committed Jun 12, 2014
1 parent af52d4b commit 345bd8d
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions Adafruit_BMP085.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
****************************************************/

#include "Adafruit_BMP085.h"
#include <util/delay.h>

Adafruit_BMP085::Adafruit_BMP085() {
}
Expand Down Expand Up @@ -72,7 +71,7 @@ int32_t Adafruit_BMP085::computeB5(int32_t UT) {

uint16_t Adafruit_BMP085::readRawTemperature(void) {
write8(BMP085_CONTROL, BMP085_READTEMPCMD);
_delay_ms(5);
delay(5);
#if BMP085_DEBUG == 1
Serial.print("Raw temp: "); Serial.println(read16(BMP085_TEMPDATA));
#endif
Expand All @@ -85,13 +84,13 @@ uint32_t Adafruit_BMP085::readRawPressure(void) {
write8(BMP085_CONTROL, BMP085_READPRESSURECMD + (oversampling << 6));

if (oversampling == BMP085_ULTRALOWPOWER)
_delay_ms(5);
delay(5);
else if (oversampling == BMP085_STANDARD)
_delay_ms(8);
delay(8);
else if (oversampling == BMP085_HIGHRES)
_delay_ms(14);
delay(14);
else
_delay_ms(26);
delay(26);

raw = read16(BMP085_PRESSUREDATA);

Expand Down

0 comments on commit 345bd8d

Please sign in to comment.