aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2024-06-05 20:20:24 -0400
committerKevin O'Connor <kevin@koconnor.net>2024-06-10 12:27:12 -0400
commit36b8831c7e7c4e4481704234fbc27dbe43026f73 (patch)
tree82c3a4fa93ebec5afc8fd977e459b7ac2805c231
parent17c645f000da6fe99bf75fd79f8e622747b1709e (diff)
downloadkutter-36b8831c7e7c4e4481704234fbc27dbe43026f73.tar.gz
kutter-36b8831c7e7c4e4481704234fbc27dbe43026f73.tar.xz
kutter-36b8831c7e7c4e4481704234fbc27dbe43026f73.zip
sensor_bulk: Change maximum data size from 52 to 51 bytes
Reduce the maximum data size from 52 bytes to 51 bytes. This will enable support for 2-byte response ids. This change would alter the behavior of the ldc1612 sensor support. Force an ldc1612 command name change so that users are alerted that they must rebuild the micro-controller code upon update of the host code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
-rw-r--r--klippy/extras/bulk_sensor.py2
-rw-r--r--klippy/extras/ldc1612.py2
-rw-r--r--src/sensor_bulk.h2
-rw-r--r--src/sensor_ldc1612.c4
4 files changed, 5 insertions, 5 deletions
diff --git a/klippy/extras/bulk_sensor.py b/klippy/extras/bulk_sensor.py
index 1720c052..b0aa320d 100644
--- a/klippy/extras/bulk_sensor.py
+++ b/klippy/extras/bulk_sensor.py
@@ -198,7 +198,7 @@ class ClockSyncRegression:
inv_freq = clock_to_print_time(base_mcu + inv_cfreq) - base_time
return base_time, base_chip, inv_freq
-MAX_BULK_MSG_SIZE = 52
+MAX_BULK_MSG_SIZE = 51
# Read sensor_bulk_data and calculate timestamps for devices that take
# samples at a fixed frequency (and produce fixed data size samples).
diff --git a/klippy/extras/ldc1612.py b/klippy/extras/ldc1612.py
index cdc01e04..281d3422 100644
--- a/klippy/extras/ldc1612.py
+++ b/klippy/extras/ldc1612.py
@@ -117,7 +117,7 @@ class LDC1612:
cmdqueue = self.i2c.get_command_queue()
self.query_ldc1612_cmd = self.mcu.lookup_command(
"query_ldc1612 oid=%c rest_ticks=%u", cq=cmdqueue)
- self.ffreader.setup_query_command("query_ldc1612_status oid=%c",
+ self.ffreader.setup_query_command("query_status_ldc1612 oid=%c",
oid=self.oid, cq=cmdqueue)
self.ldc1612_setup_home_cmd = self.mcu.lookup_command(
"ldc1612_setup_home oid=%c clock=%u threshold=%u"
diff --git a/src/sensor_bulk.h b/src/sensor_bulk.h
index 9c130bea..c750dbda 100644
--- a/src/sensor_bulk.h
+++ b/src/sensor_bulk.h
@@ -4,7 +4,7 @@
struct sensor_bulk {
uint16_t sequence, possible_overflows;
uint8_t data_count;
- uint8_t data[52];
+ uint8_t data[51];
};
void sensor_bulk_reset(struct sensor_bulk *sb);
diff --git a/src/sensor_ldc1612.c b/src/sensor_ldc1612.c
index 6e52c177..01cf3ee0 100644
--- a/src/sensor_ldc1612.c
+++ b/src/sensor_ldc1612.c
@@ -210,7 +210,7 @@ command_query_ldc1612(uint32_t *args)
DECL_COMMAND(command_query_ldc1612, "query_ldc1612 oid=%c rest_ticks=%u");
void
-command_query_ldc1612_status(uint32_t *args)
+command_query_status_ldc1612(uint32_t *args)
{
struct ldc1612 *ld = oid_lookup(args[0], command_config_ldc1612);
@@ -232,7 +232,7 @@ command_query_ldc1612_status(uint32_t *args)
uint32_t fifo = status & 0x08 ? BYTES_PER_SAMPLE : 0;
sensor_bulk_status(&ld->sb, args[0], time1, time2-time1, fifo);
}
-DECL_COMMAND(command_query_ldc1612_status, "query_ldc1612_status oid=%c");
+DECL_COMMAND(command_query_status_ldc1612, "query_status_ldc1612 oid=%c");
void
ldc1612_task(void)