From 6371895430e01ff96f6837af45725953d1c5b6bc Mon Sep 17 00:00:00 2001 From: livello Date: Sun, 18 Mar 2018 20:45:29 +0300 Subject: [PATCH] MY_CONFIG_SERVER --- lighthub/main.cpp | 7 ++++++- platformio.ini | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lighthub/main.cpp b/lighthub/main.cpp index cf57872..d89862a 100644 --- a/lighthub/main.cpp +++ b/lighthub/main.cpp @@ -755,6 +755,11 @@ void saveFlash(short n, char* str) void loadFlash(short n, char* str) {} +#ifndef MY_CONFIG_SERVER +#define CONFIG_SERVER "lazyhome.ru" +#else +#define CONFIG_SERVER QUOTE(MY_CONFIG_SERVER) +#endif int getConfig (int arg_cnt, char **args) //(char *tokens) { @@ -763,7 +768,7 @@ int getConfig (int arg_cnt, char **args) int returnCode =0; char ch; char URI [32]; - char server[32] = "ri48.ru/tid"; + char server[sizeof(CONFIG_SERVER)+21] = CONFIG_SERVER; if (arg_cnt>0) { strncpy(server,args[1],sizeof(server)-1); saveFlash(0,server); diff --git a/platformio.ini b/platformio.ini index 6a330ef..c5d2eee 100644 --- a/platformio.ini +++ b/platformio.ini @@ -42,6 +42,7 @@ platform = atmelavr board = megaatmega2560 framework = arduino ;lib_ldf_mode = chain+ +build_flags = !echo -n "-DPIO_SRC_REV="$(git rev-parse --short HEAD) lib_deps = https://github.com/anklimov/Arduino-Temperature-Control-Library.git https://github.com/anklimov/DS2482_OneWire