projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altos/rn4678: Add BLE support
[fw/altos]
/
src
/
drivers
/
ao_ms5607_convert_8051.c
diff --git
a/src/drivers/ao_ms5607_convert_8051.c
b/src/drivers/ao_ms5607_convert_8051.c
index f3a48c464b784830462bd29b840abaa57a826f11..b7081107e6407766c61d8201919ec11ff5e95855 100644
(file)
--- a/
src/drivers/ao_ms5607_convert_8051.c
+++ b/
src/drivers/ao_ms5607_convert_8051.c
@@
-3,7
+3,8
@@
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
@@
-40,30
+41,30
@@
ao_ms5607_convert(__xdata struct ao_ms5607_sample *sample,
__LOCAL ao_int64_t SENS;
__LOCAL ao_int64_t a;
__LOCAL ao_int64_t SENS;
__LOCAL ao_int64_t a;
- dT = sample->temp - ((int32_t) ms5607_prom.tref << 8);
+ dT = sample->temp - ((int32_t)
ao_
ms5607_prom.tref << 8);
- /* TEMP = 2000 + (((int64_t) dT * ms5607_prom.tempsens) >> 23); */
- ao_mul64_32_32(&a, dT, ms5607_prom.tempsens);
+ /* TEMP = 2000 + (((int64_t) dT *
ao_
ms5607_prom.tempsens) >> 23); */
+ ao_mul64_32_32(&a, dT,
ao_
ms5607_prom.tempsens);
ao_rshift64(&a, &a, 23);
TEMP = 2000 + a.low;
/* */
ao_rshift64(&a, &a, 23);
TEMP = 2000 + a.low;
/* */
- /* OFF = ((int64_t)
ms5607_prom.off << SHIFT_OFF) + (((int64_t)
ms5607_prom.tco * dT) >> SHIFT_TCO);*/
+ /* OFF = ((int64_t)
ao_ms5607_prom.off << SHIFT_OFF) + (((int64_t) ao_
ms5607_prom.tco * dT) >> SHIFT_TCO);*/
#if SHIFT_OFF > 16
#if SHIFT_OFF > 16
- OFF.high = ms5607_prom.off >> (32 - SHIFT_OFF);
+ OFF.high =
ao_
ms5607_prom.off >> (32 - SHIFT_OFF);
#else
OFF.high = 0;
#endif
#else
OFF.high = 0;
#endif
- OFF.low = (uint32_t) ms5607_prom.off << SHIFT_OFF;
- ao_mul64_32_32(&a, ms5607_prom.tco, dT);
+ OFF.low = (uint32_t)
ao_
ms5607_prom.off << SHIFT_OFF;
+ ao_mul64_32_32(&a,
ao_
ms5607_prom.tco, dT);
ao_rshift64(&a, &a, SHIFT_TCO);
ao_plus64(&OFF, &OFF, &a);
/**/
ao_rshift64(&a, &a, SHIFT_TCO);
ao_plus64(&OFF, &OFF, &a);
/**/
- /* SENS = ((int64_t)
ms5607_prom.sens << SHIFT_SENS) + (((int64_t)
ms5607_prom.tcs * dT) >> SHIFT_TCS); */
+ /* SENS = ((int64_t)
ao_ms5607_prom.sens << SHIFT_SENS) + (((int64_t) ao_
ms5607_prom.tcs * dT) >> SHIFT_TCS); */
SENS.high = 0;
SENS.high = 0;
- SENS.low = (uint32_t) ms5607_prom.sens << SHIFT_SENS;
- ao_mul64_32_32(&a, ms5607_prom.tcs, dT);
+ SENS.low = (uint32_t)
ao_
ms5607_prom.sens << SHIFT_SENS;
+ ao_mul64_32_32(&a,
ao_
ms5607_prom.tcs, dT);
ao_rshift64(&a, &a, SHIFT_TCS);
ao_plus64(&SENS, &SENS, &a);
/**/
ao_rshift64(&a, &a, SHIFT_TCS);
ao_plus64(&SENS, &SENS, &a);
/**/