Skip to content

Commit 93d592a

Browse files
author
board707
committed
Fix some I2c examples. Turn off String support in EEPROM
1 parent 79edad9 commit 93d592a

File tree

5 files changed

+18
-12
lines changed

5 files changed

+18
-12
lines changed

libraries/BasicsExamples/examples/randomNumber/randomNumber.ino

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
#include "Arduino.h"
2-
2+
/*
3+
* This code illustrates using of true random numeric generator(TRNG),
4+
* part of w80x inboard cryptomodule
5+
*
6+
* Std lib random functions also supported
7+
*
8+
*/
39
void setup() {
410
Serial.begin(115200);
5-
trngInit();
11+
trngInit(); // TRNG init
612
randomSeed(rngGet());
713
}
814

libraries/EEPROM/EEPROM.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#ifndef EEPROM_h
3232
#define EEPROM_h
3333

34-
#define ARDUINO_STRING_SUPPORT
34+
//#define ARDUINO_STRING_SUPPORT
3535
//#define EEPROM_ADVANCED
3636
//#define EEPROM_END_ADDR INSIDE_FLS_END_ADDR
3737
#define EEPROM_END_ADDR 0x80FFFFF

libraries/HardwareI2C/Scan_HardI2c/Scan_HardI2c.ino

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
#include "Arduino.h"
22
#include "HardwareI2C.h"
33

4-
HardwareI2C Wire;
4+
HardwareI2C hWire;
55
uint8_t dDev = 0;
66
uint8_t mDev[128] = {0};
77
void setup() {
88

9-
Wire.begin();
9+
hWire.begin();
1010
printf("begin to scan...\n\r");
1111
for (unsigned char i = 0; i <= 127; i++) {
1212
delay(100); // Это обязательно! У HAL есть определенный таймаут для ожидания ACK (255 приращений в цикле ожидания)
13-
if (Wire.beginTransmission(i)) {
13+
if (hWire.beginTransmission(i)) {
1414
mDev[dDev]=i;
1515
dDev++;
1616
}
17-
Wire.endTransmission();
17+
hWire.endTransmission();
1818
}
1919
// На вывод в терминал сообщений типа i2c ack error - не обращаем внимание. Его генерирует HAL и подавить его нет возможности.
2020
if (dDev == 0) printf("find nothing");

libraries/SoftwareI2C/SoftI2C_Scan/SoftI2C_Scan.ino

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
#include "Arduino.h"
22
#include "SoftwareI2C.h"
33

4-
SoftwareI2C Wire;
4+
SoftwareI2C sWire;
55
uint8_t dDev = 0;
66

77
void setup() {
8-
Wire.begin(PA12, PA14); // sda, scl
8+
sWire.begin(PA12, PA14); // sda, scl
99
printf("begin to scan...\n\r");
1010
}
1111

1212
void loop() {
1313
for (unsigned char i = 0; i <= 127; i++) {
14-
if (Wire.beginTransmission(i)) {
14+
if (sWire.beginTransmission(i)) {
1515
printf("Found i2c device at address [0x%X] \n\r",i);
1616
dDev++;
1717
}
18-
Wire.endTransmission();
18+
sWire.endTransmission();
1919
}
2020
if (dDev == 0) printf("find nothing");
2121
while (1);

libraries/Wire/i2c_scanner/i2c_scanner.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#include "Wire.h"
2-
TwoWire Wire;
2+
33

44
uint8_t dev_i2c[128] = {0};
55

0 commit comments

Comments
 (0)