Skip to content

Commit

Permalink
update GitHub actions
Browse files Browse the repository at this point in the history
  • Loading branch information
RobTillaart committed Apr 11, 2024
1 parent e899c23 commit e541fa5
Show file tree
Hide file tree
Showing 39 changed files with 170 additions and 92 deletions.
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# These are supported funding model platforms

github: RobTillaart

custom: "https://www.paypal.me/robtillaart"
6 changes: 3 additions & 3 deletions .github/workflows/arduino-lint.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@

name: Arduino-lint

on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: arduino/arduino-lint-action@v1
with:
library-manager: update
compliance: strict
compliance: strict
5 changes: 3 additions & 2 deletions .github/workflows/arduino_test_runner.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
---
name: Arduino CI

on: [push, pull_request]

jobs:
runTest:
runs-on: ubuntu-latest
timeout-minutes: 20

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
- run: |
sudo sysctl vm.mmap_rnd_bits=28
gem install arduino_ci
arduino_ci.rb
8 changes: 4 additions & 4 deletions .github/workflows/jsoncheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ on:
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: json-syntax-check
uses: limitusus/json-syntax-check@v1
uses: limitusus/json-syntax-check@v2
with:
pattern: "\\.json$"

pattern: "\\.json$"
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
# Change Log CRC
# Changelog CRC

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).


## [1.0.3] - 2024-04-11
- update GitHub actions
- add URL to examples
- minor edits

## [1.0.2] - 2023-10-19
- update readme.md (badges)
- fix changelog


## [1.0.1] - 2023-07-13
- added headers in examples
- added headers in src
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021-2023 Rob Tillaart
Copyright (c) 2021-2024 Rob Tillaart

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
14 changes: 7 additions & 7 deletions examples/CRC12_test/CRC12_test.ino
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
// FILE: CRC16_test.ino
// AUTHOR: Rob Tillaart
// PURPOSE: demo
// DATE: 2022-01-24
// (c) : MIT
// URL: https://github.com/RobTillaart/CRC


#include "CRC12.h"
#include "CRC.h"


char str1[24] = "123456789";
char str2[24] = "123456789123456789";

Expand All @@ -20,7 +20,7 @@ void setup()
Serial.begin(115200);
Serial.println(__FILE__);

// Serial.println("Verified with - http://zorc.breitbandkatze.de/crc.html \n");
// Serial.println("Verified with - http://zorc.breitbandkatze.de/crc.html \n");

test();
}
Expand Down Expand Up @@ -55,10 +55,10 @@ void test()
Serial.println(crc.count());
}

////
// reference function

uint16_t crc_check(uint8_t * ptr, uint8_t length) // crc12
// reference function

uint16_t crc_check(uint8_t * ptr, uint8_t length) // crc12
{
uint16_t crc12out = 0;
uint8_t i, j;
Expand All @@ -81,4 +81,4 @@ uint16_t crc_check(uint8_t * ptr, uint8_t length) // crc12
}


// -- END OF FILE --
// -- END OF FILE --
7 changes: 3 additions & 4 deletions examples/CRC16_test/CRC16_test.ino
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
// FILE: CRC16_test.ino
// AUTHOR: Rob Tillaart
// PURPOSE: demo
// DATE: 2021-01-20
// (c) : MIT
// URL: https://github.com/RobTillaart/CRC


#include "CRC16.h"
Expand All @@ -19,7 +18,7 @@ void setup()
Serial.begin(115200);
Serial.println(__FILE__);

// Serial.println("Verified with - http://zorc.breitbandkatze.de/crc.html \n");
// Serial.println("Verified with - http://zorc.breitbandkatze.de/crc.html \n");

test();
}
Expand Down Expand Up @@ -47,5 +46,5 @@ void test()
}


// -- END OF FILE --
// -- END OF FILE --

7 changes: 3 additions & 4 deletions examples/CRC16_test_modbus/CRC16_test_modbus.ino
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
// FILE: CRC16_test_modbus.ino
// AUTHOR: Rob Tillaart
// PURPOSE: demo
// DATE: 2023-07-25
// (c) : MIT
// URL: https://github.com/RobTillaart/CRC


#include "CRC16.h"
Expand All @@ -19,7 +18,7 @@ void setup()
Serial.begin(115200);
Serial.println(__FILE__);

// uint8_t arr[12] = { 0xFE, 0x03, 0x14, 0x00, 0x01, 0x00, 0x55, 0xA5 };
// uint8_t arr[12] = { 0xFE, 0x03, 0x14, 0x00, 0x01, 0x00, 0x55, 0xA5 };
uint8_t arr[12] = { 0xFE, 0x10, 0x04, 0x00, 0x01, 0x00, 0x01, 0x60, 0x00, 0x42, 0x58 };

for (int i = 0; i < 9; i++)
Expand All @@ -36,4 +35,4 @@ void loop()
}


// -- END OF FILE --
// -- END OF FILE --
18 changes: 16 additions & 2 deletions examples/CRC32_performance/CRC32_performance.ino
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
// FILE: CRC32_performance.ino
// AUTHOR: Rob Tillaart
// PURPOSE: demo
// DATE: 2022-01-28
// (c) : MIT
// URL: https://github.com/RobTillaart/CRC


#include "CRC32.h"
#include "FastCRC32.h"

char str[] = "Lorem ipsum dolor sit amet, \
consectetuer adipiscing elit. Aenean commodo ligula eget dolor. \
Expand Down Expand Up @@ -66,6 +66,20 @@ void test()
Serial.println(nonReversedCrc.calc(), HEX);
Serial.print("TIME: \t");
Serial.println(stop - start);
Serial.println();
delay(100);

FastCRC32 FCRC32;
start = micros();
FCRC32.add((uint8_t*)str, length);
stop = micros();
Serial.print("DATA: \t");
Serial.println(length);
Serial.print("FCRC:\t");
Serial.println(FCRC32.calc(), HEX);
Serial.print("TIME: \t");
Serial.println(stop - start);
Serial.println();
delay(100);
}

Expand Down
12 changes: 6 additions & 6 deletions examples/CRC32_performance/CRC32_performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ Test Lorum ipsum (868 bytes).
### Runtimes


| algo | output 0.3.3 | output 1.0.0 | time 0.3.3 | time 1.0.0 | delta % |
|:-----:|:--------------:|:--------------:|:----------:|:----------:|:-------:|
| CRC32 | 36ED2953 | 5E22D36F | 7468 | 8236 | +10% |
| CRC32 | BB768E7C | 5E22D36F | 8252 | 7764 | -06% |
| algo | output 0.3.3 | output 1.0.0 | time 0.3.3 | time 1.0.0 | delta % | notes |
|:---------:|:--------------:|:--------------:|:----------:|:----------:|:-------:|:------|
| CRC32 | 36ED2953 | 5E22D36F | 7468 | 8236 | +10% |
| CRC32 | BB768E7C | 5E22D36F | 8252 | 7764 | -06% |


- Output differs in 0.3.3 and from 1.0.0.
Expand All @@ -38,8 +38,8 @@ Test Lorum ipsum (868 bytes).

### Runtimes

| algo | output 0.3.3 | output 1.0.0 | time 0.3.3 | time 1.0.0 | delta % |
|:-----:|:-------------:|:--------------:|:----------:|:----------:|:-------:|
| algo | output 0.3.3 | output 1.0.0 | time 0.3.3 | time 1.0.0 | delta % | notes |
|:-----:|:-------------:|:--------------:|:----------:|:----------:|:-------:|:------|
| CRC32 | 36ED2953 | 5E22D36F | 621 | 598 | -04% |
| CRC32 | BB768E7C | 5E22D36F | 705 | 583 | -20% |

Expand Down
17 changes: 17 additions & 0 deletions examples/CRC32_performance/performance_1.0.2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

Tested on UNO
IDE 1.18.19

CRC32_performance\CRC32_performance.ino
DATA: 868
CRC: 5E22D36F
TIME: 18440

DATA: 868
CRC: 7B50E355 (no reverse)
TIME: 16688

DATA: 868
FCRC: 5E22D36F (fast CRC32 with lookup table)
TIME: 6440

7 changes: 3 additions & 4 deletions examples/CRC32_test/CRC32_test.ino
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
// FILE: CRC32_test.ino
// AUTHOR: Rob Tillaart
// PURPOSE: demo
// DATE: 2021-01-20
// (c) : MIT
// URL: https://github.com/RobTillaart/CRC


#include "CRC32.h"
Expand All @@ -18,7 +17,7 @@ void setup()
Serial.begin(115200);
Serial.println(__FILE__);

// Serial.println("Verified with - http://zorc.breitbandkatze.de/crc.html \n");
// Serial.println("Verified with - http://zorc.breitbandkatze.de/crc.html \n");

test();
}
Expand All @@ -44,5 +43,5 @@ void test()
}


// -- END OF FILE --
// -- END OF FILE --

9 changes: 4 additions & 5 deletions examples/CRC64_test/CRC64_test.ino
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@
// FILE: CRC64_test.ino
// AUTHOR: Rob Tillaart
// PURPOSE: demo
// DATE: 2021-01-20
// (c) : MIT
// URL: https://github.com/RobTillaart/CRC


#include "CRC64.h"
#include "printHelpers.h" // https://github.com/RobTillaart/printHelpers
#include "printHelpers.h" // https://github.com/RobTillaart/printHelpers

char str[24] = "123456789";

Expand All @@ -17,7 +16,7 @@ void setup()
Serial.begin(115200);
Serial.println(__FILE__);

// Serial.println("Verified with - http://zorc.breitbandkatze.de/crc.html \n");
// Serial.println("Verified with - http://zorc.breitbandkatze.de/crc.html \n");

test();
}
Expand Down Expand Up @@ -55,5 +54,5 @@ void test()
}


// -- END OF FILE --
// -- END OF FILE --

7 changes: 3 additions & 4 deletions examples/CRC8_test/CRC8_test.ino
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
// FILE: CRC8_test.ino
// AUTHOR: Rob Tillaart
// PURPOSE: demo
// DATE: 2021-01-20
// (c) : MIT
// URL: https://github.com/RobTillaart/CRC


#include "CRC8.h"
Expand All @@ -20,7 +19,7 @@ void setup()
Serial.begin(115200);
Serial.println(__FILE__);

// Serial.println("Verified with - http://zorc.breitbandkatze.de/crc.html \n");
// Serial.println("Verified with - http://zorc.breitbandkatze.de/crc.html \n");

test();
}
Expand Down Expand Up @@ -48,5 +47,5 @@ void test()
}


// -- END OF FILE --
// -- END OF FILE --

37 changes: 37 additions & 0 deletions examples/CRC8_test2/CRC8_test2.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
//
// FILE: CRC8_test.ino
// AUTHOR: Rob Tillaart
// PURPOSE: demo
// URL: https://github.com/RobTillaart/CRC


#include "CRC8.h"

byte arr[7] = { 0x13, 0x54, 0x13, 0x88, 0x00, 0x0e, 0x99 };

CRC8 crc(0x1D, 0xFF, 0xFF, false, false);


void setup()
{
Serial.begin(115200);
Serial.println(__FILE__);

crc.add((uint8_t*)arr, 7);
Serial.println(crc.calc(), HEX);

crc.restart();
for (int i = 0; i < 7; i++)
{
crc.add(arr[i]);
}
uint8_t result = crc.calc();
Serial.println(result, HEX);
Serial.println(crc.count());
}

void loop()
{
}

// -- END OF FILE --
Loading

0 comments on commit e541fa5

Please sign in to comment.