aboutsummaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'string.c')
-rw-r--r--string.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/string.c b/string.c
index 8d1cb7a..e3ebfa7 100644
--- a/string.c
+++ b/string.c
@@ -132,3 +132,11 @@ long atol(const char *ptr)
return acc;
}
+
+uint8_t csum8(uint8_t *buf, uint32_t len)
+{
+ uint32_t s = 0;
+ while (len-- > 0)
+ s += *buf++;
+ return s;
+}