Skip to content

Commit

Permalink
klipper commits to mainline (#415)
Browse files Browse the repository at this point in the history
* scripts: Update whconsole tool to support python3

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>

* heaters: Fix typo - config.config_error() instead config.error()

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>

* docs: Fix "XH711" typo in Config_Reference.md

Reported by @kabroxiko.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>

* docs: Fix Benchmarks.md git revision references

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>

---------

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Co-authored-by: Kevin O'Connor <kevin@koconnor.net>
  • Loading branch information
rogerlz and KevinOConnor authored Oct 29, 2024
1 parent d37557b commit 712a94d
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 8 deletions.
22 changes: 21 additions & 1 deletion docs/Benchmarks.md
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,26 @@ micro-controller.
| 1 stepper (200Mhz) | 39 |
| 3 stepper (200Mhz) | 181 |

### SAME70 step rate benchmark

The following configuration sequence is used on the SAME70:
```
allocate_oids count=3
config_stepper oid=0 step_pin=PC18 dir_pin=PB5 invert_step=-1 step_pulse_ticks=0
config_stepper oid=1 step_pin=PC16 dir_pin=PD10 invert_step=-1 step_pulse_ticks=0
config_stepper oid=2 step_pin=PC28 dir_pin=PA4 invert_step=-1 step_pulse_ticks=0
finalize_config crc=0
```

The test was last run on commit `34e9ea55` with gcc version
`arm-none-eabi-gcc (NixOS 10.3-2021.10) 10.3.1` on a SAME70Q20B
micro-controller.

| same70 | ticks |
| -------------------- | ----- |
| 1 stepper | 45 |
| 3 stepper | 190 |

### AR100 step rate benchmark ###

The following configuration sequence is used on AR100 CPU (Allwinner A64):
Expand All @@ -366,7 +386,7 @@ finalize_config crc=0
```

The test was last run on commit `08d037c6` with gcc version
The test was last run on commit `b7978d37` with gcc version
`or1k-linux-musl-gcc (GCC) 9.2.0` on an Allwinner A64-H
micro-controller.

Expand Down
1 change: 0 additions & 1 deletion docs/Config_Reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -5303,7 +5303,6 @@ sensor_type:
```

#### HX711
Has conversation started by @naikymen. Original line has conversation started by @naikymen.
This is a 24 bit low sample rate chip using "bit-bang" communications. It is
suitable for filament scales.
```
Expand Down
3 changes: 2 additions & 1 deletion klippy/extras/heaters.py
Original file line number Diff line number Diff line change
Expand Up @@ -993,7 +993,8 @@ def load_config(self, config):
try:
dconfig = pconfig.read_config(filename)
except Exception:
raise config.config_error("Cannot load config '%s'" % (filename,))
logging.exception("Unable to load temperature_sensors.cfg")
raise config.error("Cannot load config '%s'" % (filename,))
for c in dconfig.get_prefix_sections(""):
self.printer.load_object(dconfig, c.get_name())

Expand Down
10 changes: 5 additions & 5 deletions scripts/whconsole.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,27 +43,27 @@ def __init__(self, uds_filename):
self.poll = select.poll()
self.poll.register(sys.stdin, select.POLLIN | select.POLLHUP)
self.poll.register(self.webhook_socket, select.POLLIN | select.POLLHUP)
self.kbd_data = self.socket_data = ""
self.kbd_data = self.socket_data = b""

def process_socket(self):
data = self.webhook_socket.recv(4096)
if not data:
sys.stderr.write("Socket closed\n")
sys.exit(0)
parts = data.split("\x03")
parts = data.split(b"\x03")
parts[0] = self.socket_data + parts[0]
self.socket_data = parts.pop()
for line in parts:
sys.stdout.write("GOT: %s\n" % (line,))

def process_kbd(self):
data = os.read(self.kbd_fd, 4096)
parts = data.split("\n")
parts = data.split(b"\n")
parts[0] = self.kbd_data + parts[0]
self.kbd_data = parts.pop()
for line in parts:
line = line.strip()
if not line or line.startswith("#"):
if not line or line.startswith(b"#"):
continue
try:
m = json.loads(line)
Expand All @@ -72,7 +72,7 @@ def process_kbd(self):
continue
cm = json.dumps(m, separators=(",", ":"))
sys.stdout.write("SEND: %s\n" % (cm,))
self.webhook_socket.send("%s\x03" % (cm,))
self.webhook_socket.send(cm.encode() + b"\x03")

def run(self):
while 1:
Expand Down

0 comments on commit 712a94d

Please sign in to comment.