Skip to content

Commit

Permalink
adapt to xtimer
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-k committed Sep 29, 2015
1 parent 51ab79f commit 3b9b21c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions Makefile.dep
Original file line number Diff line number Diff line change
Expand Up @@ -263,3 +263,7 @@ endif
ifneq (,$(filter hih6130,$(USEMODULE)))
USEMODULE += vtimer
endif

ifneq (,$(filter at30tse75x,$(USEMODULE)))
USEMODULE += xtimer
endif
10 changes: 5 additions & 5 deletions drivers/at30tse75x/at30tse75x.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@


#include "periph/i2c.h"
#include "hwtimer.h"
#include "xtimer.h"

#include "at30tse75x.h"

Expand Down Expand Up @@ -69,7 +69,7 @@ static int at30tse75x_reset(at30tse75x_t* dev)
}
i2c_release(dev->i2c);
/* Wait for reset to complete */
hwtimer_spin(HWTIMER_TICKS(500));
xtimer_usleep(500);
return 0;
}

Expand Down Expand Up @@ -222,7 +222,7 @@ int at30tse75x_save_config(at30tse75x_t* dev)
}
i2c_release(dev->i2c);
/* Wait for copy to complete */
hwtimer_spin(HWTIMER_TICKS(5000));
xtimer_usleep(5000);
return 0;
}

Expand All @@ -235,7 +235,7 @@ int at30tse75x_restore_config(at30tse75x_t* dev)
}
i2c_release(dev->i2c);
/* Wait for copy to complete */
hwtimer_spin(HWTIMER_TICKS(200));
xtimer_usleep(200);
return 0;
}

Expand All @@ -262,7 +262,7 @@ int at30tse75x_get_temperature(at30tse75x_t* dev, float* temperature)
AT30TSE75X_CONFIG__RESOLUTION_SHIFT;

/* Wait until conversion is finished */
hwtimer_spin(HWTIMER_TICKS((uint32_t)(25000 << resolution)));
xtimer_usleep((uint32_t)(25000 << resolution));
}

/* Read temperature */
Expand Down

0 comments on commit 3b9b21c

Please sign in to comment.