mirror of
https://github.com/anklimov/lighthub
synced 2025-12-13 23:29:50 +03:00
Cross-compilaton for all platforms & binaries
This commit is contained in:
@@ -1517,6 +1517,33 @@ void printFirmwareVersionAndBuildOptions() {
|
||||
#else
|
||||
debugSerial<<F("\n(-)RESTART_LAN_ON_MQTT_ERRORS");
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef CSSHDC_DISABLE
|
||||
debugSerial<<F("\n(-)CCS811 & HDC1080");
|
||||
#else
|
||||
debugSerial<<F("\n(+)CCS811 & HDC1080");
|
||||
#endif
|
||||
#ifndef AC_DISABLE
|
||||
debugSerial<<F("\n(+)AC HAIER");
|
||||
#else
|
||||
debugSerial<<F("\n(-)AC HAIER");
|
||||
#endif
|
||||
#ifndef MOTOR_DISABLE
|
||||
debugSerial<<F("\n(+)MOTOR CTR");
|
||||
#else
|
||||
debugSerial<<F("\n(-)MOTOR CTR");
|
||||
#endif
|
||||
#ifndef SPILED_DISABLE
|
||||
debugSerial<<F("\n(+)SPI LED");
|
||||
#else
|
||||
debugSerial<<F("\n(-)SPI LED");
|
||||
#endif
|
||||
#ifndef FASTLED
|
||||
debugSerial<<F("\n(+)FASTLED");
|
||||
#else
|
||||
debugSerial<<F("\n(+)ADAFRUIT LED");
|
||||
#endif
|
||||
debugSerial<<endl;
|
||||
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ switch (item->getCmd())
|
||||
break;
|
||||
}
|
||||
|
||||
if (pinFeedback && (g_APinDescription[pinFeedback].ulPinAttribute & PIN_ATTR_ANALOG) == PIN_ATTR_ANALOG)
|
||||
if (pinFeedback && isAnalogPin(pinFeedback))
|
||||
{
|
||||
curPos=map(analogRead(pinFeedback),feedbackClosed,feedbackOpen,0,100);
|
||||
if (curPos<0) curPos=0;
|
||||
@@ -113,7 +113,7 @@ if (dif<-POS_ERR)
|
||||
//PIN_ATTR_ANALOG
|
||||
// uint32_t attr = g_APinDescription[pinUp].ulPinAttribute;
|
||||
// if ((attr & PIN_ATTR_PWM) == PIN_ATTR_PWM) ;
|
||||
|
||||
#ifndef ESP32
|
||||
if (digitalPinHasPWM(pinUp))
|
||||
{
|
||||
int velocity = map(-dif, 0, 10, 0, 255);
|
||||
@@ -121,6 +121,7 @@ if (digitalPinHasPWM(pinUp))
|
||||
analogWrite(pinUp,velocity);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
digitalWrite(pinUp,HIGH);
|
||||
}
|
||||
@@ -132,6 +133,7 @@ if (dif>POS_ERR)
|
||||
digitalWrite(pinUp,LOW);
|
||||
|
||||
if (!item->getExt()) item->setExt(millis()+maxOnTime);
|
||||
#ifndef ESP32
|
||||
if (digitalPinHasPWM(pinDown))
|
||||
{
|
||||
int velocity = map(dif, 0, 10, 0, 255);
|
||||
@@ -139,6 +141,7 @@ if (digitalPinHasPWM(pinDown))
|
||||
analogWrite(pinDown,velocity);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
digitalWrite(pinDown,HIGH);
|
||||
}
|
||||
|
||||
@@ -218,3 +218,33 @@
|
||||
#else
|
||||
#define W5500_ETHERNET_SHIELD
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(ARDUINO_ARCH_AVR)
|
||||
#define PINS_COUNT NUM_DIGITAL_PINS
|
||||
#define isAnalogPin(p) ((p >= 54) && (p<=69))
|
||||
#endif
|
||||
|
||||
#if defined(__SAM3X8E__)
|
||||
#define isAnalogPin(p) (g_APinDescription[p].ulPinAttribute & PIN_ATTR_ANALOG) == PIN_ATTR_ANALOG
|
||||
#endif
|
||||
|
||||
#if defined(ARDUINO_ARCH_STM32)
|
||||
#define PINS_COUNT NUM_DIGITAL_PINS
|
||||
#define isAnalogPin(p) ((p >= 44) && (p<=57))
|
||||
#endif
|
||||
|
||||
#if defined(ESP8266)
|
||||
#define PINS_COUNT NUM_DIGITAL_PINS
|
||||
#define isAnalogPin(p) ( p ==17 )
|
||||
#endif
|
||||
|
||||
#if defined(ARDUINO_ARCH_ESP32)
|
||||
#define PINS_COUNT NUM_DIGITAL_PINS
|
||||
#define isAnalogPin(p) ((p ==4) || (p>=12)&& (p<=15) || (p>=25)&& (p<=27)||(p>=32)&& (p<=33) || (p>=37)&& (p<=38))
|
||||
#endif
|
||||
|
||||
#if defined(NRF5)
|
||||
#define PINS_COUNT NUM_DIGITAL_PINS
|
||||
#define isAnalogPin(p) ((p >= 14) && (p<=21))
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user