Skip to content

Commit a572a68

Browse files
authored
fix ESP32 begin() parameters (#22)
1 parent 818cb6d commit a572a68

File tree

6 files changed

+24
-10
lines changed

6 files changed

+24
-10
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
55
and this project adheres to [Semantic Versioning](http://semver.org/).
66

77

8+
## [0.4.1] - 2022-09-24
9+
10+
### Added
11+
- changed ESP32 **begin()** parameters to **int** to prevent link error.
12+
see https://github.com/RobTillaart/PCA9635/issues/17
13+
14+
### Changed
15+
- updated documentation
16+
17+
818
## [0.4.0] - 2022-05-02
919

1020
### Added

FRAM.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// FILE: FRAM.cpp
33
// AUTHOR: Rob Tillaart
4-
// VERSION: 0.4.0
4+
// VERSION: 0.4.1
55
// DATE: 2018-01-24
66
// PURPOSE: Arduino library for I2C FRAM
77
// URL: https://github.com/RobTillaart/FRAM_I2C
@@ -39,7 +39,8 @@ FRAM::FRAM(TwoWire *wire)
3939

4040

4141
#if defined (ESP8266) || defined(ESP32)
42-
int FRAM::begin(uint8_t sda, uint8_t scl, const uint8_t address, int8_t writeProtectPin)
42+
int FRAM::begin(int sda, int scl, const uint8_t address,
43+
const int8_t writeProtectPin)
4344
{
4445
if ((address < 0x50) || (address > 0x57)) return FRAM_ERROR_ADDR;
4546

@@ -64,7 +65,8 @@ int FRAM::begin(uint8_t sda, uint8_t scl, const uint8_t address, int8_t writePro
6465
#endif
6566

6667

67-
int FRAM::begin(uint8_t address, int8_t writeProtectPin)
68+
int FRAM::begin(const uint8_t address,
69+
const int8_t writeProtectPin)
6870
{
6971
if ((address < 0x50) || (address > 0x57)) return FRAM_ERROR_ADDR;
7072

FRAM.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// FILE: FRAM.h
44
// AUTHOR: Rob Tillaart
5-
// VERSION: 0.4.0
5+
// VERSION: 0.4.1
66
// DATE: 2018-01-24
77
// PURPOSE: Arduino library for I2C FRAM
88
// URL: https://github.com/RobTillaart/FRAM_I2C
@@ -13,7 +13,7 @@
1313
#include "Wire.h"
1414

1515

16-
#define FRAM_LIB_VERSION (F("0.4.0"))
16+
#define FRAM_LIB_VERSION (F("0.4.1"))
1717

1818

1919
#define FRAM_OK 0
@@ -38,10 +38,12 @@ class FRAM
3838

3939
#if defined (ESP8266) || defined(ESP32)
4040
// address and writeProtectPin is optional
41-
int begin(uint8_t sda, uint8_t scl, const uint8_t address = 0x50, int8_t writeProtectPin = -1);
41+
int begin(int sda, int scl, const uint8_t address = 0x50,
42+
const int8_t writeProtectPin = -1);
4243
#endif
4344
// address and writeProtectPin is optional
44-
int begin(const uint8_t address = 0x50, int8_t writeProtectPin = -1);
45+
int begin(const uint8_t address = 0x50,
46+
const int8_t writeProtectPin = -1);
4547
bool isConnected();
4648

4749
void write8(uint16_t memaddr, uint8_t value);

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ This latter will not be shown on an I2C scanner (to be tested).
5757
- **FRAM32(TwoWire \*wire = &Wire)** Constructor with optional Wire interface, specific for **MB85RC1MT** type of device.
5858
- **int begin(uint8_t address = 0x50, int8_t writeProtectPin = -1)** address and writeProtectPin is optional.
5959
Note the **MB85RC1MT** only uses even addresses.
60-
- **int begin(uint8_t sda, uint8_t scl, uint8_t address = 0x50, int8_t writeProtectPin = -1)** idem for ESP32 a.o.
60+
- **int begin(int sda, int scl, uint8_t address = 0x50, int8_t writeProtectPin = -1)** idem for ESP32 a.o.
6161
- **bool isConnected()** checks if the address is visible on the I2C bus.
6262

6363

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"type": "git",
1616
"url": "https://github.com/RobTillaart/FRAM_I2C.git"
1717
},
18-
"version": "0.4.0",
18+
"version": "0.4.1",
1919
"license": "MIT",
2020
"frameworks": "arduino",
2121
"platforms": "*",

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=FRAM_I2C
2-
version=0.4.0
2+
version=0.4.1
33
author=Rob Tillaart <[email protected]>
44
maintainer=Rob Tillaart <[email protected]>
55
sentence=Arduino library for I2C FRAM.

0 commit comments

Comments
 (0)