aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2023-12-17 11:30:23 -0500
committerKevin O'Connor <kevin@koconnor.net>2024-01-19 11:55:15 -0500
commit3275614b895c409f30cc9520c02990b18abad3c6 (patch)
tree6c3d2850562ec798eb32b982eedefd9d56c015f1 /src
parent83d0d2f19b81550e82d6f68415dfcd6df90dee69 (diff)
downloadkutter-3275614b895c409f30cc9520c02990b18abad3c6.tar.gz
kutter-3275614b895c409f30cc9520c02990b18abad3c6.tar.xz
kutter-3275614b895c409f30cc9520c02990b18abad3c6.zip
sensor_adxl345: No need to send messages when stopping queries
Simplify the mcu code as any messages are ignored by the host anyway. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src')
-rw-r--r--src/sensor_adxl345.c18
1 files changed, 0 insertions, 18 deletions
diff --git a/src/sensor_adxl345.c b/src/sensor_adxl345.c
index 3d80059d..5ec3945e 100644
--- a/src/sensor_adxl345.c
+++ b/src/sensor_adxl345.c
@@ -148,25 +148,7 @@ adxl_stop(struct adxl345 *ax, uint8_t oid)
sched_del_timer(&ax->timer);
ax->flags = 0;
uint8_t msg[2] = { AR_POWER_CTL, 0x00 };
- uint32_t end1_time = timer_read_time();
spidev_transfer(ax->spi, 0, sizeof(msg), msg);
- uint32_t end2_time = timer_read_time();
- // Drain any measurements still in fifo
- uint_fast8_t i;
- for (i=0; i<33; i++) {
- msg[0] = AR_FIFO_STATUS | AM_READ;
- msg[1] = 0x00;
- spidev_transfer(ax->spi, 1, sizeof(msg), msg);
- uint_fast8_t fifo_status = msg[1] & ~0x80;
- if (!fifo_status)
- break;
- if (fifo_status <= 32)
- adxl_query(ax, oid);
- }
- // Report final data
- if (ax->data_count)
- adxl_report(ax, oid);
- adxl_status(ax, oid, end1_time, end2_time, msg[1]);
}
void