summaryrefslogtreecommitdiffstats
path: root/ihex.c
diff options
context:
space:
mode:
authorAttila Veghelyi <aveghelyi@dension.com>2023-06-29 16:24:54 +0200
committerAttila Veghelyi <aveghelyi@dension.com>2023-06-29 16:24:54 +0200
commit925d0670c45e1100e412070fa0ce2405604f219a (patch)
tree9bb4412d148bc80751b7a02023cd3e0167f588e7 /ihex.c
downloadOpenProgrammer-925d0670c45e1100e412070fa0ce2405604f219a.tar.gz
OpenProgrammer-925d0670c45e1100e412070fa0ce2405604f219a.zip
Init repo
Diffstat (limited to 'ihex.c')
-rw-r--r--ihex.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/ihex.c b/ihex.c
new file mode 100644
index 0000000..39d3b94
--- /dev/null
+++ b/ihex.c
@@ -0,0 +1,15 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+
+int main (int argc, char **argv) {
+ int i,s=0,t;
+ for (i = 1; i < argc; i++){
+ sscanf(argv[i], "%X", &t);
+ s+=t;
+ }
+ printf("checksum=%02X\n",(-s)&0xff);
+ return 0;
+}
+