Merge pull request #28 from CloneTV/master

Fix warning define DEFAULT_SDA, DEFAULT_SCL
This commit is contained in:
Renzo Mischianti 2020-10-16 12:42:47 +02:00 committed by GitHub
commit c5fbc06d4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -43,9 +43,6 @@
#include "WProgram.h" #include "WProgram.h"
#endif #endif
#define DEFAULT_SDA SDA;
#define DEFAULT_SCL SCL;
// Uncomment to enable printing out nice debug messages. // Uncomment to enable printing out nice debug messages.
// #define PCF8574_DEBUG // #define PCF8574_DEBUG
@ -170,17 +167,31 @@ public:
private: private:
uint8_t _address; uint8_t _address;
#ifdef __STM32F1__ #if !defined(DEFAULT_SDA)
#ifndef SDA # if defined(__STM32F1__)
#define DEFAULT_SDA PB7 # define DEFAULT_SDA PB7
#define DEFAULT_SCL PB6 # elif defined(ESP8266)
# define DEFAULT_SDA 4
# elif defined(SDA)
# define DEFAULT_SDA SDA
# else
# error "Error define DEFAULT_SDA, SDA not declared"
# endif
#endif #endif
#if !defined(DEFAULT_SCL)
# if defined(__STM32F1__)
# define DEFAULT_SCL PB6
# elif defined(ESP8266)
# define DEFAULT_SCL 5
# elif defined(SDA)
# define DEFAULT_SCL SCL
# else
# error "Error define DEFAULT_SCL, SCL not declared"
# endif
#endif #endif
uint8_t _sda = DEFAULT_SDA uint8_t _sda = DEFAULT_SDA;
; uint8_t _scl = DEFAULT_SCL;
uint8_t _scl = DEFAULT_SCL
;
TwoWire *_wire; TwoWire *_wire;
@ -218,3 +229,4 @@ private:
}; };
#endif #endif