Switch AVR libc _delay_ms usage to Arduino delay function for better compatibility with non-AVR boards.
This commit is contained in:
parent
af52d4b186
commit
345bd8db3a
1 changed files with 5 additions and 6 deletions
|
|
@ -16,7 +16,6 @@
|
|||
****************************************************/
|
||||
|
||||
#include "Adafruit_BMP085.h"
|
||||
#include <util/delay.h>
|
||||
|
||||
Adafruit_BMP085::Adafruit_BMP085() {
|
||||
}
|
||||
|
|
@ -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
|
||||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue