mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-23 10:46:31 +00:00
pin configs and renames to prepare PR
This commit is contained in:
parent
a4e613a992
commit
8d48cf3731
@ -635,6 +635,8 @@
|
||||
#define D_SENSOR_SLAVE_RESET "Slave RST"
|
||||
#define D_SENSOR_GPS_RX "GPS RX"
|
||||
#define D_SENSOR_GPS_TX "GPS TX"
|
||||
#define D_SENSOR_HM10_RX "HM10 RX"
|
||||
#define D_SENSOR_HM10_TX "HM10 TX"
|
||||
|
||||
// Units
|
||||
#define D_UNIT_AMPERE "A"
|
||||
|
@ -635,6 +635,8 @@
|
||||
#define D_SENSOR_SLAVE_RESET "Slave RST"
|
||||
#define D_SENSOR_GPS_RX "GPS RX"
|
||||
#define D_SENSOR_GPS_TX "GPS TX"
|
||||
#define D_SENSOR_HM10_RX "HM10 RX"
|
||||
#define D_SENSOR_HM10_TX "HM10 TX"
|
||||
|
||||
// Units
|
||||
#define D_UNIT_AMPERE "A"
|
||||
|
@ -635,6 +635,8 @@
|
||||
#define D_SENSOR_SLAVE_RESET "Slave RST"
|
||||
#define D_SENSOR_GPS_RX "GPS RX"
|
||||
#define D_SENSOR_GPS_TX "GPS TX"
|
||||
#define D_SENSOR_HM10_RX "HM10 RX"
|
||||
#define D_SENSOR_HM10_TX "HM10 TX"
|
||||
|
||||
// Units
|
||||
#define D_UNIT_AMPERE "A"
|
||||
|
@ -635,6 +635,8 @@
|
||||
#define D_SENSOR_SLAVE_RESET "Slave RST"
|
||||
#define D_SENSOR_GPS_RX "GPS RX"
|
||||
#define D_SENSOR_GPS_TX "GPS TX"
|
||||
#define D_SENSOR_HM10_RX "HM10 RX"
|
||||
#define D_SENSOR_HM10_TX "HM10 TX"
|
||||
|
||||
// Units
|
||||
#define D_UNIT_AMPERE "A"
|
||||
|
@ -635,6 +635,8 @@
|
||||
#define D_SENSOR_SLAVE_RESET "Slave RST"
|
||||
#define D_SENSOR_GPS_RX "GPS RX"
|
||||
#define D_SENSOR_GPS_TX "GPS TX"
|
||||
#define D_SENSOR_HM10_RX "HM10 RX"
|
||||
#define D_SENSOR_HM10_TX "HM10 TX"
|
||||
|
||||
// Units
|
||||
#define D_UNIT_AMPERE "A"
|
||||
|
@ -635,6 +635,8 @@
|
||||
#define D_SENSOR_SLAVE_RESET "Slave RST"
|
||||
#define D_SENSOR_GPS_RX "GPS RX"
|
||||
#define D_SENSOR_GPS_TX "GPS TX"
|
||||
#define D_SENSOR_HM10_RX "HM10 RX"
|
||||
#define D_SENSOR_HM10_TX "HM10 TX"
|
||||
|
||||
// Units
|
||||
#define D_UNIT_AMPERE "A"
|
||||
|
@ -635,6 +635,8 @@
|
||||
#define D_SENSOR_SLAVE_RESET "Esclave Rst"
|
||||
#define D_SENSOR_GPS_TX "GPS TX"
|
||||
#define D_SENSOR_GPS_RX "GPS RX"
|
||||
#define D_SENSOR_HM10_RX "HM10 RX"
|
||||
#define D_SENSOR_HM10_TX "HM10 TX"
|
||||
|
||||
// Units
|
||||
#define D_UNIT_AMPERE "A"
|
||||
|
@ -635,6 +635,8 @@
|
||||
#define D_SENSOR_SLAVE_RESET "Slave RST"
|
||||
#define D_SENSOR_GPS_RX "GPS RX"
|
||||
#define D_SENSOR_GPS_TX "GPS TX"
|
||||
#define D_SENSOR_HM10_RX "HM10 RX"
|
||||
#define D_SENSOR_HM10_TX "HM10 TX"
|
||||
|
||||
// Units
|
||||
#define D_UNIT_AMPERE "A"
|
||||
|
@ -635,6 +635,8 @@
|
||||
#define D_SENSOR_SLAVE_RESET "Slave RST"
|
||||
#define D_SENSOR_GPS_RX "GPS RX"
|
||||
#define D_SENSOR_GPS_TX "GPS TX"
|
||||
#define D_SENSOR_HM10_RX "HM10 RX"
|
||||
#define D_SENSOR_HM10_TX "HM10 TX"
|
||||
|
||||
// Units
|
||||
#define D_UNIT_AMPERE "A"
|
||||
|
@ -635,6 +635,8 @@
|
||||
#define D_SENSOR_SLAVE_RESET "Slave RST"
|
||||
#define D_SENSOR_GPS_RX "GPS RX"
|
||||
#define D_SENSOR_GPS_TX "GPS TX"
|
||||
#define D_SENSOR_HM10_RX "HM10 RX"
|
||||
#define D_SENSOR_HM10_TX "HM10 TX"
|
||||
|
||||
// Units
|
||||
#define D_UNIT_AMPERE "A"
|
||||
|
@ -635,6 +635,8 @@
|
||||
#define D_SENSOR_SLAVE_RESET "Slave RST"
|
||||
#define D_SENSOR_GPS_RX "GPS RX"
|
||||
#define D_SENSOR_GPS_TX "GPS TX"
|
||||
#define D_SENSOR_HM10_RX "HM10 RX"
|
||||
#define D_SENSOR_HM10_TX "HM10 TX"
|
||||
|
||||
// Units
|
||||
#define D_UNIT_AMPERE "A"
|
||||
|
@ -635,6 +635,8 @@
|
||||
#define D_SENSOR_SLAVE_RESET "Slave RST"
|
||||
#define D_SENSOR_GPS_RX "GPS RX"
|
||||
#define D_SENSOR_GPS_TX "GPS TX"
|
||||
#define D_SENSOR_HM10_RX "HM10 RX"
|
||||
#define D_SENSOR_HM10_TX "HM10 TX"
|
||||
|
||||
// Units
|
||||
#define D_UNIT_AMPERE "A"
|
||||
|
@ -635,6 +635,8 @@
|
||||
#define D_SENSOR_SLAVE_RESET "Slave RST"
|
||||
#define D_SENSOR_GPS_RX "GPS RX"
|
||||
#define D_SENSOR_GPS_TX "GPS TX"
|
||||
#define D_SENSOR_HM10_RX "HM10 RX"
|
||||
#define D_SENSOR_HM10_TX "HM10 TX"
|
||||
|
||||
// Units
|
||||
#define D_UNIT_AMPERE "A"
|
||||
|
@ -635,6 +635,8 @@
|
||||
#define D_SENSOR_SLAVE_RESET "Slave RST"
|
||||
#define D_SENSOR_GPS_RX "GPS RX"
|
||||
#define D_SENSOR_GPS_TX "GPS TX"
|
||||
#define D_SENSOR_HM10_RX "HM10 RX"
|
||||
#define D_SENSOR_HM10_TX "HM10 TX"
|
||||
|
||||
// Units
|
||||
#define D_UNIT_AMPERE "A"
|
||||
|
@ -635,6 +635,8 @@
|
||||
#define D_SENSOR_SLAVE_RESET "Slave RST"
|
||||
#define D_SENSOR_GPS_RX "GPS RX"
|
||||
#define D_SENSOR_GPS_TX "GPS TX"
|
||||
#define D_SENSOR_HM10_RX "HM10 RX"
|
||||
#define D_SENSOR_HM10_TX "HM10 TX"
|
||||
|
||||
// Units
|
||||
#define D_UNIT_AMPERE "A"
|
||||
|
@ -635,6 +635,8 @@
|
||||
#define D_SENSOR_SLAVE_RESET "Slave RST"
|
||||
#define D_SENSOR_GPS_RX "GPS RX"
|
||||
#define D_SENSOR_GPS_TX "GPS TX"
|
||||
#define D_SENSOR_HM10_RX "HM10 RX"
|
||||
#define D_SENSOR_HM10_TX "HM10 TX"
|
||||
|
||||
// Units
|
||||
#define D_UNIT_AMPERE "А"
|
||||
|
@ -635,6 +635,8 @@
|
||||
#define D_SENSOR_SLAVE_RESET "Slave RST"
|
||||
#define D_SENSOR_GPS_RX "GPS RX"
|
||||
#define D_SENSOR_GPS_TX "GPS TX"
|
||||
#define D_SENSOR_HM10_RX "HM10 RX"
|
||||
#define D_SENSOR_HM10_TX "HM10 TX"
|
||||
|
||||
// Units
|
||||
#define D_UNIT_AMPERE "A"
|
||||
|
@ -635,6 +635,8 @@
|
||||
#define D_SENSOR_SLAVE_RESET "Slave RST"
|
||||
#define D_SENSOR_GPS_RX "GPS RX"
|
||||
#define D_SENSOR_GPS_TX "GPS TX"
|
||||
#define D_SENSOR_HM10_RX "HM10 RX"
|
||||
#define D_SENSOR_HM10_TX "HM10 TX"
|
||||
|
||||
// Units
|
||||
#define D_UNIT_AMPERE "A"
|
||||
|
@ -635,6 +635,8 @@
|
||||
#define D_SENSOR_SLAVE_RESET "Slave RST"
|
||||
#define D_SENSOR_GPS_RX "GPS RX"
|
||||
#define D_SENSOR_GPS_TX "GPS TX"
|
||||
#define D_SENSOR_HM10_RX "HM10 RX"
|
||||
#define D_SENSOR_HM10_TX "HM10 TX"
|
||||
|
||||
// Units
|
||||
#define D_UNIT_AMPERE "A"
|
||||
|
@ -635,6 +635,8 @@
|
||||
#define D_SENSOR_SLAVE_RESET "Slave RST"
|
||||
#define D_SENSOR_GPS_RX "GPS RX"
|
||||
#define D_SENSOR_GPS_TX "GPS TX"
|
||||
#define D_SENSOR_HM10_RX "HM10 RX"
|
||||
#define D_SENSOR_HM10_TX "HM10 TX"
|
||||
|
||||
// Units
|
||||
#define D_UNIT_AMPERE "А"
|
||||
|
@ -635,6 +635,8 @@
|
||||
#define D_SENSOR_SLAVE_RESET "Slave RST"
|
||||
#define D_SENSOR_GPS_RX "GPS RX"
|
||||
#define D_SENSOR_GPS_TX "GPS TX"
|
||||
#define D_SENSOR_HM10_RX "HM10 RX"
|
||||
#define D_SENSOR_HM10_TX "HM10 TX"
|
||||
|
||||
// Units
|
||||
#define D_UNIT_AMPERE "安"
|
||||
|
@ -635,6 +635,8 @@
|
||||
#define D_SENSOR_SLAVE_RESET "Slave RST"
|
||||
#define D_SENSOR_GPS_RX "GPS RX"
|
||||
#define D_SENSOR_GPS_TX "GPS TX"
|
||||
#define D_SENSOR_HM10_RX "HM10 RX"
|
||||
#define D_SENSOR_HM10_TX "HM10 TX"
|
||||
|
||||
// Units
|
||||
#define D_UNIT_AMPERE "安"
|
||||
|
@ -542,6 +542,7 @@
|
||||
//#define USE_IBEACON // Add support for bluetooth LE passive scan of ibeacon devices (uses HM17 module)
|
||||
//#define USE_GPS // Add support for GPS and NTP Server for becoming Stratus 1 Time Source (+ 3.1kb flash, +132 bytes RAM)
|
||||
// #define USE_FLOG // Add support for GPS logging in OTA's Flash (Experimental) (+ 2.9kb flash, +8 bytes RAM)
|
||||
#define USE_HM10 // Add support for HM-10 as a BLE-bridge for the LYWSD03 (+... code)
|
||||
|
||||
// -- Power monitoring sensors --------------------
|
||||
#define USE_ENERGY_MARGIN_DETECTION // Add support for Energy Margin detection (+1k6 code)
|
||||
|
@ -216,6 +216,8 @@ enum UserSelectablePins {
|
||||
GPIO_HPMA_TX, // Honeywell HPMA115S0 Serial interface
|
||||
GPIO_GPS_RX, // GPS serial interface
|
||||
GPIO_GPS_TX, // GPS serial interface
|
||||
GPIO_HM10_RX, // HM10-BLE-Mijia-bridge serial interface
|
||||
GPIO_HM10_TX, // HM10-BLE-Mijia-bridge serial interface
|
||||
GPIO_SENSOR_END };
|
||||
|
||||
// Programmer selectable GPIO functionality
|
||||
@ -296,7 +298,7 @@ const char kSensorNames[] PROGMEM =
|
||||
D_SENSOR_DEEPSLEEP "|" D_SENSOR_EXS_ENABLE "|"
|
||||
D_SENSOR_SLAVE_TX "|" D_SENSOR_SLAVE_RX "|" D_SENSOR_SLAVE_RESET "|" D_SENSOR_SLAVE_RESET "i|"
|
||||
D_SENSOR_HPMA_RX "|" D_SENSOR_HPMA_TX "|"
|
||||
D_SENSOR_GPS_RX "|" D_SENSOR_GPS_TX
|
||||
D_SENSOR_GPS_RX "|" D_SENSOR_GPS_TX "|" D_SENSOR_HM10_RX "|" D_SENSOR_HM10_TX
|
||||
;
|
||||
|
||||
const char kSensorNamesFixed[] PROGMEM =
|
||||
@ -737,6 +739,10 @@ const uint8_t kGpioNiceList[] PROGMEM = {
|
||||
GPIO_GPS_RX, // GPS serial interface
|
||||
GPIO_GPS_TX, // GPS serial interface
|
||||
#endif
|
||||
#ifdef USE_HM10
|
||||
GPIO_HM10_RX, // GPS serial interface
|
||||
GPIO_HM10_TX, // GPS serial interface
|
||||
#endif
|
||||
|
||||
#ifdef USE_MGC3130
|
||||
GPIO_MGC3130_XFER,
|
||||
|
@ -22,15 +22,13 @@
|
||||
--------------------------------------------------------------------------------------------
|
||||
|
||||
---
|
||||
0.9.0.0 20200130 started - initial development by Christian Baars
|
||||
0.9.0.0 20200130 started - initial development by Christian Baars (support LYWSD03 only)
|
||||
forked - from arendst/tasmota - https://github.com/arendst/Tasmota
|
||||
|
||||
*/
|
||||
#ifdef USE_HM10
|
||||
|
||||
#define XSNS_92 92
|
||||
|
||||
#define HM_PIN_RX 5 // D1 Hardcoded while developing
|
||||
#define HM_PIN_TX 4 // D2
|
||||
#define XSNS_62 62
|
||||
|
||||
#include <TasmotaSerial.h>
|
||||
#include <vector>
|
||||
@ -263,7 +261,7 @@ uint32_t MIBLEgetSensorSlot(uint8_t (&_serial)[6], uint8_t _type){
|
||||
void HM10SerialInit(void) {
|
||||
HM10.mode.init = false;
|
||||
HM10.serialSpeed = HM10_BAUDRATE;
|
||||
HM10Serial = new TasmotaSerial(HM_PIN_RX, HM_PIN_TX, 1, 0, HM10_MAX_RX_BUF);
|
||||
HM10Serial = new TasmotaSerial(pin[GPIO_HM10_RX], pin[GPIO_HM10_TX], 1, 0, HM10_MAX_RX_BUF);
|
||||
if (HM10Serial->begin(HM10.serialSpeed)) {
|
||||
AddLog_P2(LOG_LEVEL_DEBUG, PSTR("%s start serial communication fixed to 115200 baud"),D_CMND_HM10);
|
||||
if (HM10Serial->hardwareSerial()) {
|
||||
@ -728,18 +726,17 @@ void HM10Show(bool json)
|
||||
* Interface
|
||||
\*********************************************************************************************/
|
||||
|
||||
bool Xsns92(uint8_t function)
|
||||
bool Xsns62(uint8_t function)
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
// if ((pin[HM_PIN_RX] < 99) && (pin[HM_PIN_TX] < 99)) {
|
||||
if (true) {
|
||||
if ((pin[GPIO_HM10_RX] < 99) && (pin[GPIO_HM10_TX] < 99)) {
|
||||
switch (function) {
|
||||
case FUNC_INIT:
|
||||
HM10SerialInit(); // init and start communication
|
||||
break;
|
||||
case FUNC_EVERY_50_MSECOND:
|
||||
HM10SerialHandleFeedback(); // -> sniff for device feedback very often
|
||||
HM10SerialHandleFeedback(); // check for device feedback very often
|
||||
break;
|
||||
case FUNC_EVERY_100_MSECOND:
|
||||
if (HM10_TASK_LIST[0][0] != TASK_HM10_NOTASK) {
|
||||
@ -763,4 +760,5 @@ bool Xsns92(uint8_t function)
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
#endif //USE_HM10
|
Loading…
x
Reference in New Issue
Block a user