aboutsummaryrefslogtreecommitdiff
path: root/puzzle
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-05-28 15:29:50 +0200
committerLoek Le Blansch <loek@pipeframe.xyz>2024-05-28 15:29:50 +0200
commit0a58df884713c06720e87819522b81421a910654 (patch)
tree53b60f830070c74fcf4ecd766d017426f8f33141 /puzzle
parent085a2c16d07bfe3616dfdecfe5815ff1dc5b51a6 (diff)
fix spelling mistake
Diffstat (limited to 'puzzle')
-rw-r--r--puzzle/spec.adoc6
1 files changed, 4 insertions, 2 deletions
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);
}