|
7 | 7 | #include "linux/LinuxHardwareI2C.h" |
8 | 8 | #endif |
9 | 9 | #if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) |
10 | | -#include "main.h" // atecc |
11 | 10 | #include "meshUtils.h" // vformat |
12 | 11 | #endif |
13 | 12 |
|
@@ -84,40 +83,6 @@ ScanI2C::DeviceType ScanI2CTwoWire::probeOLED(ScanI2C::DeviceAddress addr) const |
84 | 83 |
|
85 | 84 | return o_probe; |
86 | 85 | } |
87 | | -void ScanI2CTwoWire::printATECCInfo() const |
88 | | -{ |
89 | | -#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) |
90 | | - atecc.readConfigZone(false); |
91 | | - |
92 | | - std::string atecc_numbers = "ATECC608B Serial Number: "; |
93 | | - for (int i = 0; i < 9; i++) { |
94 | | - atecc_numbers += vformat("%02x", atecc.serialNumber[i]); |
95 | | - } |
96 | | - |
97 | | - atecc_numbers += ", Rev Number: "; |
98 | | - for (int i = 0; i < 4; i++) { |
99 | | - atecc_numbers += vformat("%02x", atecc.revisionNumber[i]); |
100 | | - } |
101 | | - LOG_DEBUG(atecc_numbers.c_str()); |
102 | | - |
103 | | - LOG_DEBUG("ATECC608B Config %s, Data %s, Slot 0 %s", atecc.configLockStatus ? "Locked" : "Unlocked", |
104 | | - atecc.dataOTPLockStatus ? "Locked" : "Unlocked", atecc.slot0LockStatus ? "Locked" : "Unlocked"); |
105 | | - |
106 | | - std::string atecc_publickey = ""; |
107 | | - if (atecc.configLockStatus && atecc.dataOTPLockStatus && atecc.slot0LockStatus) { |
108 | | - if (atecc.generatePublicKey() == false) { |
109 | | - atecc_publickey += "ATECC608B Error generating public key"; |
110 | | - } else { |
111 | | - atecc_publickey += "ATECC608B Public Key: "; |
112 | | - for (int i = 0; i < 64; i++) { |
113 | | - atecc_publickey += vformat("%02x", atecc.publicKey64Bytes[i]); |
114 | | - } |
115 | | - } |
116 | | - LOG_DEBUG(atecc_publickey.c_str()); |
117 | | - } |
118 | | -#endif |
119 | | -} |
120 | | - |
121 | 86 | uint16_t ScanI2CTwoWire::getRegisterValue(const ScanI2CTwoWire::RegisterLocation ®isterLocation, |
122 | 87 | ScanI2CTwoWire::ResponseWidth responseWidth) const |
123 | 88 | { |
@@ -203,23 +168,6 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize) |
203 | 168 | type = probeOLED(addr); |
204 | 169 | break; |
205 | 170 |
|
206 | | -#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) |
207 | | - case ATECC608B_ADDR: |
208 | | -#ifdef RP2040_SLOW_CLOCK |
209 | | - if (atecc.begin(addr.address, Wire, Serial2) == true) |
210 | | -#else |
211 | | - if (atecc.begin(addr.address) == true) |
212 | | -#endif |
213 | | - |
214 | | - { |
215 | | - LOG_INFO("ATECC608B initialized"); |
216 | | - } else { |
217 | | - LOG_WARN("ATECC608B initialization failed"); |
218 | | - } |
219 | | - printATECCInfo(); |
220 | | - break; |
221 | | -#endif |
222 | | - |
223 | 171 | #ifdef RV3028_RTC |
224 | 172 | case RV3028_RTC: |
225 | 173 | // foundDevices[addr] = RTC_RV3028; |
|
0 commit comments