mirror of
https://github.com/arendst/Tasmota.git
synced 2025-04-27 00:07:17 +00:00
Add ESP32 fingerprint support
This commit is contained in:
parent
85e7f07ef4
commit
08f6b09414
@ -54,7 +54,7 @@
|
|||||||
PUBLIC FUNCTIONS
|
PUBLIC FUNCTIONS
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#if defined(__AVR__) || defined(ESP8266) || defined(FREEDOM_E300_HIFIVE1)
|
#if defined(__AVR__) || defined(ESP8266) || defined(ESP32) || defined(FREEDOM_E300_HIFIVE1)
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
/*!
|
/*!
|
||||||
@brief Instantiates sensor with Software Serial
|
@brief Instantiates sensor with Software Serial
|
||||||
@ -87,7 +87,7 @@ Adafruit_Fingerprint::Adafruit_Fingerprint(HardwareSerial *hs,
|
|||||||
thePassword = password;
|
thePassword = password;
|
||||||
theAddress = 0xFFFFFFFF;
|
theAddress = 0xFFFFFFFF;
|
||||||
|
|
||||||
#if defined(__AVR__) || defined(ESP8266) || defined(FREEDOM_E300_HIFIVE1)
|
#if defined(__AVR__) || defined(ESP8266) || defined(ESP32) || defined(FREEDOM_E300_HIFIVE1)
|
||||||
swSerial = NULL;
|
swSerial = NULL;
|
||||||
#endif
|
#endif
|
||||||
hwSerial = hs;
|
hwSerial = hs;
|
||||||
@ -109,7 +109,7 @@ Adafruit_Fingerprint::Adafruit_Fingerprint(Stream *serial, uint32_t password) {
|
|||||||
theAddress = 0xFFFFFFFF;
|
theAddress = 0xFFFFFFFF;
|
||||||
|
|
||||||
hwSerial = NULL;
|
hwSerial = NULL;
|
||||||
#if defined(__AVR__) || defined(ESP8266) || defined(FREEDOM_E300_HIFIVE1)
|
#if defined(__AVR__) || defined(ESP8266) || defined(ESP32) || defined(FREEDOM_E300_HIFIVE1)
|
||||||
swSerial = NULL;
|
swSerial = NULL;
|
||||||
#endif
|
#endif
|
||||||
mySerial = serial;
|
mySerial = serial;
|
||||||
@ -126,7 +126,7 @@ void Adafruit_Fingerprint::begin(uint32_t baudrate) {
|
|||||||
|
|
||||||
if (hwSerial)
|
if (hwSerial)
|
||||||
hwSerial->begin(baudrate);
|
hwSerial->begin(baudrate);
|
||||||
#if defined(__AVR__) || defined(ESP8266) || defined(FREEDOM_E300_HIFIVE1)
|
#if defined(__AVR__) || defined(ESP8266) || defined(ESP32) || defined(FREEDOM_E300_HIFIVE1)
|
||||||
if (swSerial)
|
if (swSerial)
|
||||||
swSerial->begin(baudrate);
|
swSerial->begin(baudrate);
|
||||||
#endif
|
#endif
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "Arduino.h"
|
#include "Arduino.h"
|
||||||
#if defined(__AVR__) || defined(ESP8266)
|
#if defined(__AVR__) || defined(ESP8266) || defined(ESP32)
|
||||||
//#include <SoftwareSerial.h>
|
//#include <SoftwareSerial.h>
|
||||||
#include <TasmotaSerial.h>
|
#include <TasmotaSerial.h>
|
||||||
#elif defined(FREEDOM_E300_HIFIVE1)
|
#elif defined(FREEDOM_E300_HIFIVE1)
|
||||||
@ -129,7 +129,7 @@ struct Adafruit_Fingerprint_Packet {
|
|||||||
///! Helper class to communicate with and keep state for fingerprint sensors
|
///! Helper class to communicate with and keep state for fingerprint sensors
|
||||||
class Adafruit_Fingerprint {
|
class Adafruit_Fingerprint {
|
||||||
public:
|
public:
|
||||||
#if defined(__AVR__) || defined(ESP8266) || defined(FREEDOM_E300_HIFIVE1)
|
#if defined(__AVR__) || defined(ESP8266) || defined(ESP32) || defined(FREEDOM_E300_HIFIVE1)
|
||||||
// Adafruit_Fingerprint(SoftwareSerial *ss, uint32_t password = 0x0);
|
// Adafruit_Fingerprint(SoftwareSerial *ss, uint32_t password = 0x0);
|
||||||
Adafruit_Fingerprint(TasmotaSerial *ss, uint32_t password = 0x0);
|
Adafruit_Fingerprint(TasmotaSerial *ss, uint32_t password = 0x0);
|
||||||
#endif
|
#endif
|
||||||
@ -186,7 +186,7 @@ private:
|
|||||||
uint8_t recvPacket[20];
|
uint8_t recvPacket[20];
|
||||||
|
|
||||||
Stream *mySerial;
|
Stream *mySerial;
|
||||||
#if defined(__AVR__) || defined(ESP8266) || defined(FREEDOM_E300_HIFIVE1)
|
#if defined(__AVR__) || defined(ESP8266) || defined(ESP32) || defined(FREEDOM_E300_HIFIVE1)
|
||||||
// SoftwareSerial *swSerial;
|
// SoftwareSerial *swSerial;
|
||||||
TasmotaSerial *swSerial;
|
TasmotaSerial *swSerial;
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user