DMX Modbus OneWire support now can be disabled

This commit is contained in:
livello
2018-03-23 13:35:52 +03:00
parent ca44c66387
commit 642f20de8c
6 changed files with 86 additions and 74 deletions

View File

@@ -125,6 +125,9 @@ platformio device monitor -b 115200
* Wiz5500 //Use Wiznet 5500 library instead Wiznet 5100 * Wiz5500 //Use Wiznet 5500 library instead Wiznet 5100
* DISABLE_FREERAM_PRINT // disable printing free Ram in bytes * DISABLE_FREERAM_PRINT // disable printing free Ram in bytes
* CUSTOM_FIRMWARE_MAC=de:ad:be:ef:fe:00 //set firmware macaddress * 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. 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) * Wiznet 5100 (for MEGA & DUE)
* Free Ram printing enabled * Free Ram printing enabled
* de:ad:be:ef:fe:00 * de:ad:be:ef:fe:00
* DMX support enabled
* Modbus support enabled
* OneWire support enabled

View File

@@ -14,5 +14,8 @@
export FLAGS="$FLAGS -DWiz5500" export FLAGS="$FLAGS -DWiz5500"
export FLAGS="$FLAGS -DDISABLE_FREERAM_PRINT" export FLAGS="$FLAGS -DDISABLE_FREERAM_PRINT"
export FLAGS="$FLAGS -DCUSTOM_FIRMWARE_MAC=de:ad:be:ef:fe:00" 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" export PLATFORMIO_BUILD_FLAGS="$FLAGS"
unset FLAGS unset FLAGS

View File

@@ -122,9 +122,10 @@ DueFlashStorage EEPROM;
#define wdt_en() #define wdt_en()
#define wdt_dis() #define wdt_dis()
#else #else
#include "Dhcp.h"
#ifdef Wiz5500 #ifdef Wiz5500
#include <Ethernet2.h> #include <Ethernet2.h>
#else #else
@@ -447,31 +448,24 @@ if((wifiMulti.run() == WL_CONNECTED)) lanStatus=1;
wdt_dis(); wdt_dis();
if (lanStatus > 0) if (lanStatus > 0)
switch (Ethernet.maintain()) { switch (Ethernet.maintain()) {
case 1: case DHCP_CHECK_RENEW_FAIL:
//renewed fail //renewed fail
Serial.println(F("Error: renewed fail")); Serial.println(F("Error: renewed fail"));
lanStatus = -10; lanStatus = -10;
break; break;
case 2: case DHCP_CHECK_RENEW_OK:
//renewed success
Serial.println(F("Renewed success")); Serial.println(F("Renewed success"));
//print your local IP address:
printIPAddress(); printIPAddress();
break; break;
case 3: case DHCP_CHECK_REBIND_FAIL:
//rebind fail
Serial.println(F("Error: rebind fail")); Serial.println(F("Error: rebind fail"));
lanStatus = -10; lanStatus = -10;
break; break;
case 4: case DHCP_CHECK_REBIND_OK:
//rebind success
Serial.println(F("Rebind success")); Serial.println(F("Rebind success"));
//print your local IP address:
printIPAddress(); printIPAddress();
break; break;

View File

@@ -1,8 +1,17 @@
// Configuration of drivers enabled // Configuration of drivers enabled
#ifndef DMX_DISABLE
#define _dmxin #define _dmxin
#define _dmxout #define _dmxout
#endif
#ifndef OWIRE_DISABLE
#define _owire #define _owire
#endif
#ifndef MODBUS_DISABLE
#define _modbus #define _modbus
#endif
#define _artnet #define _artnet
#if defined(ESP8266) #if defined(ESP8266)

View File

@@ -19,6 +19,7 @@ e-mail anklimov@gmail.com
*/ */
#include "utils.h" #include "utils.h"
#if defined(__SAM3X8E__) #if defined(__SAM3X8E__)
#include <malloc.h> #include <malloc.h>
#endif #endif
@@ -51,8 +52,8 @@ void SetBytes(uint8_t* addr, uint8_t count, char * out) {
} }
byte HEX2DEC(char i) byte HEX2DEC(char i) {
{ byte v; byte v;
if ('a' <= i && i <= 'f') { v = i - 97 + 10; } if ('a' <= i && i <= 'f') { v = i - 97 + 10; }
else if ('A' <= i && i <= 'F') { v = i - 65 + 10; } else if ('A' <= i && i <= 'F') { v = i - 65 + 10; }
else if ('0' <= i && i <= '9') { v = i - 48; } 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); int ch = atoi(*chan);
*chan = strchr(*chan, ','); *chan = strchr(*chan, ',');
@@ -98,8 +98,7 @@ unsigned long freeRam ()
extern char _end; extern char _end;
extern "C" char *sbrk(int i); extern "C" char *sbrk(int i);
unsigned long freeRam() unsigned long freeRam() {
{
char *ramstart = (char *) 0x20070000; char *ramstart = (char *) 0x20070000;
char *ramend = (char *) 0x20088000; char *ramend = (char *) 0x20088000;
char *heapend = sbrk(0); char *heapend = sbrk(0);
@@ -108,6 +107,7 @@ unsigned long freeRam()
return stack_ptr - heapend + mi.fordblks; return stack_ptr - heapend + mi.fordblks;
} }
#endif #endif
void parseBytes(const char *str, char separator, byte *bytes, int maxBytes, int base) { void parseBytes(const char *str, char separator, byte *bytes, int maxBytes, int base) {

View File

@@ -10,8 +10,8 @@
[platformio] [platformio]
src_dir = lighthub src_dir = lighthub
env_default = env_default =
megaatmega2560 ; megaatmega2560
; due due
; esp8266 ; esp8266
[env:due] [env:due]