changed main.h -> main.conf

This commit is contained in:
Klaus K Wilting 2018-03-30 20:51:49 +02:00
parent 875ad77967
commit f6f63b6a57
8 changed files with 127 additions and 132 deletions

View File

@ -34,9 +34,9 @@ build_flags =
;needed for ESP32 BLE Ardunio v0.4.9 ;needed for ESP32 BLE Ardunio v0.4.9
-fexceptions -fexceptions
-std=c++11 -std=c++11
;override lora settings from LMiC library in lmic/config.h and use main.h instead ;override lora settings from LMiC library in lmic/config.h and use main.conf instead
-D_lmic_config_h_ -D_lmic_config_h_
-include "src/main.h" -include "src/main.conf"
-include "src/hal/heltec.h" -include "src/hal/heltec.h"
;FreeRTOS single core operation, switches off core 1 (see arduino-esp32/cores/esp32/main.cpp) ;FreeRTOS single core operation, switches off core 1 (see arduino-esp32/cores/esp32/main.cpp)
; -DCONFIG_FREERTOS_UNICORE ; -DCONFIG_FREERTOS_UNICORE
@ -56,9 +56,9 @@ build_flags =
;needed for ESP32 BLE Ardunio v0.4.9 ;needed for ESP32 BLE Ardunio v0.4.9
-fexceptions -fexceptions
-std=c++11 -std=c++11
;override lora settings from LMiC library in lmic/config.h and use main.h instead ;override lora settings from LMiC library in lmic/config.h and use main.conf instead
-D_lmic_config_h_ -D_lmic_config_h_
-include "src/main.h" -include "src/main.conf"
-include "src/hal/ttgov1.h" -include "src/hal/ttgov1.h"
;FreeRTOS single core operation, switches off core 1 (see arduino-esp32/cores/esp32/main.cpp) ;FreeRTOS single core operation, switches off core 1 (see arduino-esp32/cores/esp32/main.cpp)
; -DCONFIG_FREERTOS_UNICORE ; -DCONFIG_FREERTOS_UNICORE
@ -78,9 +78,9 @@ build_flags =
;needed for ESP32 BLE Ardunio v0.4.9 ;needed for ESP32 BLE Ardunio v0.4.9
-fexceptions -fexceptions
-std=c++11 -std=c++11
;override lora settings from LMiC library in lmic/config.h and use main.h instead ;override lora settings from LMiC library in lmic/config.h and use main.conf instead
-D_lmic_config_h_ -D_lmic_config_h_
-include "src/main.h" -include "src/main.conf"
-include "src/hal/ttgov2.h" -include "src/hal/ttgov2.h"
;FreeRTOS single core operation, switches off core 1 (see arduino-esp32/cores/esp32/main.cpp) ;FreeRTOS single core operation, switches off core 1 (see arduino-esp32/cores/esp32/main.cpp)
; -DCONFIG_FREERTOS_UNICORE ; -DCONFIG_FREERTOS_UNICORE
@ -101,9 +101,9 @@ build_flags =
;needed for ESP32 BLE Ardunio v0.4.9 ;needed for ESP32 BLE Ardunio v0.4.9
-fexceptions -fexceptions
-std=c++11 -std=c++11
;override lora settings from LMiC library in lmic/config.h and use main.h instead ;override lora settings from LMiC library in lmic/config.h and use main.conf instead
-D_lmic_config_h_ -D_lmic_config_h_
-include "src/main.h" -include "src/main.conf"
-include "src/hal/lopy.h" -include "src/hal/lopy.h"
;FreeRTOS single core operation, switches off core 1 (see arduino-esp32/cores/esp32/main.cpp) ;FreeRTOS single core operation, switches off core 1 (see arduino-esp32/cores/esp32/main.cpp)
; -DCONFIG_FREERTOS_UNICORE ; -DCONFIG_FREERTOS_UNICORE
@ -124,9 +124,9 @@ build_flags =
;needed for ESP32 BLE Ardunio v0.4.9 ;needed for ESP32 BLE Ardunio v0.4.9
-fexceptions -fexceptions
-std=c++11 -std=c++11
;override lora settings from LMiC library in lmic/config.h and use main.h instead ;override lora settings from LMiC library in lmic/config.h and use main.conf instead
-D_lmic_config_h_ -D_lmic_config_h_
-include "src/main.h" -include "src/main.conf"
-include "src/hal/lopy4.h" -include "src/hal/lopy4.h"
;FreeRTOS single core operation, switches off core 1 (see arduino-esp32/cores/esp32/main.cpp) ;FreeRTOS single core operation, switches off core 1 (see arduino-esp32/cores/esp32/main.cpp)
; -DCONFIG_FREERTOS_UNICORE ; -DCONFIG_FREERTOS_UNICORE
@ -148,9 +148,9 @@ build_flags =
;needed for ESP32 BLE Ardunio v0.4.9 ;needed for ESP32 BLE Ardunio v0.4.9
-fexceptions -fexceptions
-std=c++11 -std=c++11
;override lora settings from LMiC library in lmic/config.h and use main.h instead ;override lora settings from LMiC library in lmic/config.h and use main.conf instead
-D_lmic_config_h_ -D_lmic_config_h_
-include "src/main.h" -include "src/main.conf"
-include "src/hal/lolin32lite_lora.h" -include "src/hal/lolin32lite_lora.h"
;FreeRTOS single core operation, switches off core 1 (see arduino-esp32/cores/esp32/main.cpp) ;FreeRTOS single core operation, switches off core 1 (see arduino-esp32/cores/esp32/main.cpp)
; -DCONFIG_FREERTOS_UNICORE ; -DCONFIG_FREERTOS_UNICORE
@ -172,9 +172,9 @@ build_flags =
;needed for ESP32 BLE Ardunio v0.4.9 ;needed for ESP32 BLE Ardunio v0.4.9
-fexceptions -fexceptions
-std=c++11 -std=c++11
;override lora settings from LMiC library in lmic/config.h and use main.h instead ;override lora settings from LMiC library in lmic/config.h and use main.conf instead
-D_lmic_config_h_ -D_lmic_config_h_
-include "src/main.h" -include "src/main.conf"
-include "src/hal/lolin32_lora.h" -include "src/hal/lolin32_lora.h"
;FreeRTOS single core operation, switches off core 1 (see arduino-esp32/cores/esp32/main.cpp) ;FreeRTOS single core operation, switches off core 1 (see arduino-esp32/cores/esp32/main.cpp)
; -DCONFIG_FREERTOS_UNICORE ; -DCONFIG_FREERTOS_UNICORE

View File

@ -1,6 +1,6 @@
/* configmanager persists runtime configuration using NVRAM of ESP32*/ /* configmanager persists runtime configuration using NVRAM of ESP32*/
#include "main.h" #include "main.conf"
#include "globals.h" #include "globals.h"
#include <nvs.h> #include <nvs.h>
#include <nvs_flash.h> #include <nvs_flash.h>
@ -19,7 +19,7 @@ esp_err_t err;
// populate cfg vars with factory settings // populate cfg vars with factory settings
void defaultConfig() { void defaultConfig() {
cfg.lorasf = LORASFDEFAULT; // 7-12, initial lora spreadfactor defined in main.h cfg.lorasf = LORASFDEFAULT; // 7-12, initial lora spreadfactor defined in main.conf
cfg.txpower = 15; // 2-15, lora tx power cfg.txpower = 15; // 2-15, lora tx power
cfg.adrmode = 1; // 0=disabled, 1=enabled cfg.adrmode = 1; // 0=disabled, 1=enabled
cfg.screensaver = 0; // 0=disabled, 1=enabled cfg.screensaver = 0; // 0=disabled, 1=enabled

View File

@ -12,7 +12,6 @@
#include <hal/hal.h> #include <hal/hal.h>
// Struct holding devices's runtime configuration // Struct holding devices's runtime configuration
typedef struct { typedef struct {
int8_t lorasf; // 7-12, lora spreadfactor int8_t lorasf; // 7-12, lora spreadfactor
int8_t txpower; // 2-15, lora tx power int8_t txpower; // 2-15, lora tx power
@ -35,7 +34,6 @@ extern uint64_t uptimecounter;
extern osjob_t sendjob; extern osjob_t sendjob;
extern int macnum, blenum, countermode, screensaver, adrmode, lorasf, txpower, rlim; extern int macnum, blenum, countermode, screensaver, adrmode, lorasf, txpower, rlim;
extern bool joinstate; extern bool joinstate;
//extern std::set<uint64_t, std::greater <uint64_t> > macs;
extern std::set<uint64_t> macs; extern std::set<uint64_t> macs;
#ifdef HAS_DISPLAY #ifdef HAS_DISPLAY

View File

@ -1,5 +1,5 @@
// Basic Config // Basic Config
#include "main.h" #include "main.conf"
#include "globals.h" #include "globals.h"
// LMIC-Arduino LoRaWAN Stack // LMIC-Arduino LoRaWAN Stack

View File

@ -22,12 +22,9 @@ Refer to LICENSE.txt file in repository for more details.
*/ */
// Basic Config // Basic Config
#include "main.h" #include "main.conf"
#include "globals.h" #include "globals.h"
// std::set for unified array functions
#include <set>
// OLED driver // OLED driver
#include <U8x8lib.h> #include <U8x8lib.h>

View File

@ -3,7 +3,7 @@
// checks commands and executes each command with 1 argument per command // checks commands and executes each command with 1 argument per command
// Basic Config // Basic Config
#include "main.h" #include "main.conf"
#include "globals.h" #include "globals.h"
// LMIC-Arduino LoRaWAN Stack // LMIC-Arduino LoRaWAN Stack

View File

@ -1,5 +1,5 @@
// Basic Config // Basic Config
#include "main.h" #include "main.conf"
#include "globals.h" #include "globals.h"
// ESP32 Functions // ESP32 Functions
@ -37,7 +37,7 @@ extern void wifi_sniffer_packet_handler(void *buff, wifi_promiscuous_pkt_type_t
void wifi_sniffer_init(void) { void wifi_sniffer_init(void) {
wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT(); wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
cfg.nvs_enable = 0; // we don't want wifi settings from NVRAM cfg.nvs_enable = 0; // we don't need any wifi settings from NVRAM
wifi_promiscuous_filter_t filter = {.filter_mask = WIFI_PROMIS_FILTER_MASK_MGMT}; // we need only MGMT frames wifi_promiscuous_filter_t filter = {.filter_mask = WIFI_PROMIS_FILTER_MASK_MGMT}; // we need only MGMT frames
ESP_ERROR_CHECK(esp_wifi_init(&cfg)); ESP_ERROR_CHECK(esp_wifi_init(&cfg));
ESP_ERROR_CHECK(esp_wifi_set_country(&wifi_country)); ESP_ERROR_CHECK(esp_wifi_set_country(&wifi_country));