From 0a58df884713c06720e87819522b81421a910654 Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Tue, 28 May 2024 15:29:50 +0200 Subject: fix spelling mistake --- puzzle/spec.adoc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'puzzle') diff --git a/puzzle/spec.adoc b/puzzle/spec.adoc index ff936be..9f36556 100644 --- a/puzzle/spec.adoc +++ b/puzzle/spec.adoc @@ -58,7 +58,7 @@ Example C code: #include "puzbus.h" void pb_cmd_magic_handler(const char * data, size_t sz) { - if (sz != siezof(pb_magic_msg)) return; + if (sz != sizeof(pb_magic_msg)) return; if (memcmp(buf, pb_magic_msg, sizeof(pb_magic_msg)) != 0) return; const char res[] = { @@ -72,7 +72,9 @@ void pb_cmd_magic_handler(const char * data, size_t sz) { void i2c_read_handle(uint16_t addr, const char * buf, size_t sz) { if (sz < 1) return; pb_cmd_t cmd = (pb_cmd_t) buf[0]; - buf++; sz--; // shift buffer + + // shift buffer pointer to only contain the puzzle bus message data + buf++; sz--; if (cmd == PB_CMD_MAGIC) pb_cmd_magic_handler(buf, sz); } -- cgit v1.2.3