projects
/
bertos.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
AT91SAM7: Use correct number of flash wait states; set correct FMCN.
[bertos.git]
/
bertos
/
drv
/
tmp123.c
diff --git
a/bertos/drv/tmp123.c
b/bertos/drv/tmp123.c
index 9fcc9165c16efe9f924a308b5dfd53e952bed436..cce2696a2daf8e4c0943f8336e24922590db6e26 100644
(file)
--- a/
bertos/drv/tmp123.c
+++ b/
bertos/drv/tmp123.c
@@
-46,17
+46,19
@@
#include <kern/kfile.h>
#include <kern/kfile.h>
+#include <drv/ntc.h> // Macro and data type to manage celsius degree
+
/**
* Read temperature from TMP123 chip.
*/
/**
* Read temperature from TMP123 chip.
*/
-de
ci_celsius
_t tmp123_read(KFile *fd)
+de
g
_t tmp123_read(KFile *fd)
{
int16_t tmp;
{
int16_t tmp;
-
CS_ENABLE
();
+
TMP123_HW_CS_EN
();
kfile_read(fd, &tmp, sizeof(tmp));
tmp = be16_to_cpu(tmp);
kfile_read(fd, &tmp, sizeof(tmp));
tmp = be16_to_cpu(tmp);
-
CS_DISABLE
();
+
TMP123_HW_CS_DIS
();
tmp >>= 3;
return DIV_ROUND((tmp * 10), 16);
tmp >>= 3;
return DIV_ROUND((tmp * 10), 16);