projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altos: Use new ao_spi_speed inline to set SPI speeds using spec'd frequencies
[fw/altos]
/
src
/
drivers
/
ao_adxl375.c
diff --git
a/src/drivers/ao_adxl375.c
b/src/drivers/ao_adxl375.c
index 66d39ff915b625c6f87acac828594ff1f8a6ad4b..c7cf78af7d8f7940c985a10c2171630a6c606d77 100644
(file)
--- a/
src/drivers/ao_adxl375.c
+++ b/
src/drivers/ao_adxl375.c
@@
-26,6
+26,8
@@
#define PRINTD(l,...)
#endif
#define PRINTD(l,...)
#endif
+#define AO_ADXL375_SPI_SPEED ao_spi_speed(5000000)
+
struct ao_adxl375_sample ao_adxl375_current;
static void
struct ao_adxl375_sample ao_adxl375_current;
static void
@@
-143,7
+145,7
@@
ao_adxl375_setup(void)
uint8_t devid = ao_adxl375_reg_read(AO_ADXL375_DEVID);
if (devid != AO_ADXL375_DEVID_ID)
uint8_t devid = ao_adxl375_reg_read(AO_ADXL375_DEVID);
if (devid != AO_ADXL375_DEVID_ID)
-
ao_sensor_errors = 1
;
+
AO_SENSOR_ERROR(AO_DATA_ADXL375)
;
/* Set the data rate */
ao_adxl375_reg_write(AO_ADXL375_BW_RATE,
/* Set the data rate */
ao_adxl375_reg_write(AO_ADXL375_BW_RATE,
@@
-204,12
+206,12
@@
ao_adxl375_setup(void)
self_test_value = z_change;
if (z_change < MIN_SELF_TEST)
self_test_value = z_change;
if (z_change < MIN_SELF_TEST)
-
ao_sensor_errors = 1
;
+
AO_SENSOR_ERROR(AO_DATA_ADXL375)
;
/* This check is commented out as maximum self test is unreliable
if (z_change > MAX_SELF_TEST)
/* This check is commented out as maximum self test is unreliable
if (z_change > MAX_SELF_TEST)
-
ao_sensor_errors = 1
;
+
AO_SENSOR_ERROR(AO_DATA_ADXL375)
;
*/
*/
@@
-235,13
+237,13
@@
static struct ao_task ao_adxl375_task;
static void
ao_adxl375_dump(void)
{
static void
ao_adxl375_dump(void)
{
- printf ("ADXL375 value %d %d %d self test %
d min %d max %
d\n",
+ printf ("ADXL375 value %d %d %d self test %
ld min %ld max %l
d\n",
ao_adxl375_current.x,
ao_adxl375_current.y,
ao_adxl375_current.z,
ao_adxl375_current.x,
ao_adxl375_current.y,
ao_adxl375_current.z,
- self_test_value,
- MIN_SELF_TEST,
- MAX_SELF_TEST);
+
(long)
self_test_value,
+
(long)
MIN_SELF_TEST,
+
(long)
MAX_SELF_TEST);
}
const struct ao_cmds ao_adxl375_cmds[] = {
}
const struct ao_cmds ao_adxl375_cmds[] = {