Skip to content

Commit a17d5e9

Browse files
authored
Merge pull request #84 from andreagilardoni/zephyr-support
Initial zephyr support
2 parents 7c7fbd5 + 5740d4c commit a17d5e9

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

.github/workflows/compile-examples.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,15 @@ jobs:
5858
artifact-name-suffix: arduino-mbed_opta-opta
5959
- fqbn: arduino:mbed_giga:giga
6060
artifact-name-suffix: arduino-mbed_giga-giga
61+
- fqbn: "arduino:zephyr_main:portentah7"
62+
platform-name: arduino:zephyr_main
63+
artifact-name-suffix: arduino-zephyr_main-portentah7
64+
- fqbn: "arduino:zephyr_main:giga"
65+
platform-name: arduino:zephyr_main
66+
artifact-name-suffix: arduino-zephyr_main-giga
67+
- fqbn: "arduino:zephyr_main:opta"
68+
platform-name: arduino:zephyr_main
69+
artifact-name-suffix: arduino-zephyr_main-opta
6170

6271
steps:
6372
- name: Checkout

src/ECCX08.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
const uint32_t ECCX08Class::_wakeupFrequency = 100000u; // 100 kHz
2525
#ifdef __AVR__
2626
const uint32_t ECCX08Class::_normalFrequency = 400000u; // 400 kHz
27+
#elif defined(ARDUINO_ARCH_ZEPHYR) && defined(ARDUINO_PORTENTA_H7_M7)
28+
// FIXME speed above 400kHz require manual configuration in stm32 running on zephyr
29+
const uint32_t ECCX08Class::_normalFrequency = 400000u;
2730
#else
2831
const uint32_t ECCX08Class::_normalFrequency = 1000000u; // 1 MHz
2932
#endif
@@ -970,6 +973,12 @@ uint16_t ECCX08Class::crc16(const byte data[], size_t length)
970973
return crc;
971974
}
972975

976+
#if __ZEPHYR__
977+
#ifndef CRYPTO_WIRE
978+
#define CRYPTO_WIRE Wire1
979+
#endif
980+
#endif
981+
973982
#ifdef CRYPTO_WIRE
974983
ECCX08Class ECCX08(CRYPTO_WIRE, 0x60);
975984
#else

0 commit comments

Comments
 (0)