working wersion with elements

This commit is contained in:
Dmitry Borisenko
2020-08-26 15:44:19 +03:00
parent e3f3ae7664
commit 90e6822d3b
23 changed files with 247 additions and 203 deletions

View File

@@ -1,7 +1,9 @@
#include "Utils/SysUtils.h"
#include "Utils/PrintMessage.h"
#include "Global.h"
static const char* MODULE = "Main";
const String getUniqueId(const char* name) {
return String(name) + getMacAddress();
}
@@ -20,6 +22,11 @@ const String getChipId() {
return res;
}
void setChipId() {
chipId = getChipId();
pm.info("id: " + chipId);
}
#ifdef ESP8266
static uint32_t total_memory = 52864;
#else
@@ -69,6 +76,48 @@ const String getMacAddress() {
return String(buf);
}
#ifdef ESP8266
void setLedStatus(LedStatus_t status) {
pinMode(LED_PIN, OUTPUT);
switch (status) {
case LED_OFF:
noTone(LED_PIN);
digitalWrite(LED_PIN, HIGH);
break;
case LED_ON:
noTone(LED_PIN);
digitalWrite(LED_PIN, LOW);
break;
case LED_SLOW:
tone(LED_PIN, 1);
break;
case LED_FAST:
tone(LED_PIN, 20);
break;
default:
break;
}
}
#else
void setLedStatus(LedStatus_t status) {
pinMode(LED_PIN, OUTPUT);
switch (status) {
case LED_OFF:
digitalWrite(LED_PIN, HIGH);
break;
case LED_ON:
digitalWrite(LED_PIN, LOW);
break;
case LED_SLOW:
break;
case LED_FAST:
break;
default:
break;
}
}
#endif
//===================================================================
/*
void web_print (String text) {