mirror of
https://github.com/anklimov/lighthub
synced 2025-12-10 05:39:51 +03:00
DMX Modbus OneWire support now can be disabled
This commit is contained in:
@@ -125,6 +125,9 @@ platformio device monitor -b 115200
|
||||
* Wiz5500 //Use Wiznet 5500 library instead Wiznet 5100
|
||||
* DISABLE_FREERAM_PRINT // disable printing free Ram in bytes
|
||||
* CUSTOM_FIRMWARE_MAC=de:ad:be:ef:fe:00 //set firmware macaddress
|
||||
* DMX_DISABLE //disable DMX support
|
||||
* MODBUS_DISABLE // disable Modbus support
|
||||
* OWIRE_DISABLE // disable OneWire support
|
||||
|
||||
Look at build_flags_template.sh for customizing.
|
||||
|
||||
@@ -137,3 +140,6 @@ Look at build_flags_template.sh for customizing.
|
||||
* Wiznet 5100 (for MEGA & DUE)
|
||||
* Free Ram printing enabled
|
||||
* de:ad:be:ef:fe:00
|
||||
* DMX support enabled
|
||||
* Modbus support enabled
|
||||
* OneWire support enabled
|
||||
|
||||
@@ -14,5 +14,8 @@
|
||||
export FLAGS="$FLAGS -DWiz5500"
|
||||
export FLAGS="$FLAGS -DDISABLE_FREERAM_PRINT"
|
||||
export FLAGS="$FLAGS -DCUSTOM_FIRMWARE_MAC=de:ad:be:ef:fe:00"
|
||||
export FLAGS="$FLAGS -DDMX_DISABLE"
|
||||
export FLAGS="$FLAGS -DMODBUS_DISABLE"
|
||||
export FLAGS="$FLAGS -DOWIRE_DISABLE"
|
||||
export PLATFORMIO_BUILD_FLAGS="$FLAGS"
|
||||
unset FLAGS
|
||||
@@ -122,9 +122,10 @@ DueFlashStorage EEPROM;
|
||||
#define wdt_en()
|
||||
#define wdt_dis()
|
||||
|
||||
|
||||
#else
|
||||
|
||||
#include "Dhcp.h"
|
||||
|
||||
#ifdef Wiz5500
|
||||
#include <Ethernet2.h>
|
||||
#else
|
||||
@@ -447,31 +448,24 @@ if((wifiMulti.run() == WL_CONNECTED)) lanStatus=1;
|
||||
wdt_dis();
|
||||
if (lanStatus > 0)
|
||||
switch (Ethernet.maintain()) {
|
||||
case 1:
|
||||
case DHCP_CHECK_RENEW_FAIL:
|
||||
//renewed fail
|
||||
Serial.println(F("Error: renewed fail"));
|
||||
lanStatus = -10;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
//renewed success
|
||||
case DHCP_CHECK_RENEW_OK:
|
||||
Serial.println(F("Renewed success"));
|
||||
|
||||
//print your local IP address:
|
||||
printIPAddress();
|
||||
break;
|
||||
|
||||
case 3:
|
||||
//rebind fail
|
||||
case DHCP_CHECK_REBIND_FAIL:
|
||||
Serial.println(F("Error: rebind fail"));
|
||||
lanStatus = -10;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
//rebind success
|
||||
case DHCP_CHECK_REBIND_OK:
|
||||
Serial.println(F("Rebind success"));
|
||||
|
||||
//print your local IP address:
|
||||
printIPAddress();
|
||||
break;
|
||||
|
||||
|
||||
@@ -1,8 +1,17 @@
|
||||
// Configuration of drivers enabled
|
||||
#ifndef DMX_DISABLE
|
||||
#define _dmxin
|
||||
#define _dmxout
|
||||
#endif
|
||||
|
||||
#ifndef OWIRE_DISABLE
|
||||
#define _owire
|
||||
#endif
|
||||
|
||||
#ifndef MODBUS_DISABLE
|
||||
#define _modbus
|
||||
#endif
|
||||
|
||||
#define _artnet
|
||||
|
||||
#if defined(ESP8266)
|
||||
|
||||
@@ -19,6 +19,7 @@ e-mail anklimov@gmail.com
|
||||
*/
|
||||
|
||||
#include "utils.h"
|
||||
|
||||
#if defined(__SAM3X8E__)
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
@@ -51,8 +52,8 @@ void SetBytes(uint8_t* addr, uint8_t count, char * out) {
|
||||
}
|
||||
|
||||
|
||||
byte HEX2DEC(char i)
|
||||
{ byte v;
|
||||
byte HEX2DEC(char i) {
|
||||
byte v;
|
||||
if ('a' <= i && i <= 'f') { v = i - 97 + 10; }
|
||||
else if ('A' <= i && i <= 'F') { v = i - 65 + 10; }
|
||||
else if ('0' <= i && i <= '9') { v = i - 48; }
|
||||
@@ -68,8 +69,7 @@ void SetAddr(char * out, uint8_t* addr) {
|
||||
}
|
||||
|
||||
|
||||
int getInt(char ** chan)
|
||||
{
|
||||
int getInt(char **chan) {
|
||||
int ch = atoi(*chan);
|
||||
*chan = strchr(*chan, ',');
|
||||
|
||||
@@ -98,8 +98,7 @@ unsigned long freeRam ()
|
||||
extern char _end;
|
||||
extern "C" char *sbrk(int i);
|
||||
|
||||
unsigned long freeRam()
|
||||
{
|
||||
unsigned long freeRam() {
|
||||
char *ramstart = (char *) 0x20070000;
|
||||
char *ramend = (char *) 0x20088000;
|
||||
char *heapend = sbrk(0);
|
||||
@@ -108,6 +107,7 @@ unsigned long freeRam()
|
||||
|
||||
return stack_ptr - heapend + mi.fordblks;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void parseBytes(const char *str, char separator, byte *bytes, int maxBytes, int base) {
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
[platformio]
|
||||
src_dir = lighthub
|
||||
env_default =
|
||||
megaatmega2560
|
||||
; due
|
||||
; megaatmega2560
|
||||
due
|
||||
; esp8266
|
||||
|
||||
[env:due]
|
||||
|
||||
Reference in New Issue
Block a user