#include cleanup

This commit is contained in:
Klaus K Wilting 2020-03-29 18:08:52 +02:00
parent 11e91bbd00
commit 87d93f6978
31 changed files with 54 additions and 108 deletions

View File

@ -1,9 +1,12 @@
#ifndef _BMESENSOR_H #ifndef _BMESENSOR_H
#define _BMESENSOR_H #define _BMESENSOR_H
#include "globals.h"
#include <Wire.h> #include <Wire.h>
#include "globals.h"
#include "irqhandler.h"
#include "configmanager.h"
#ifdef HAS_BME680 #ifdef HAS_BME680
#include <bsec.h> #include <bsec.h>
#elif defined HAS_BME280 #elif defined HAS_BME280

View File

@ -2,6 +2,10 @@
#define _BUTTON_H #define _BUTTON_H
#include <SimpleButton.h> #include <SimpleButton.h>
#include "irqhandler.h"
#include "senddata.h"
#include "display.h"
#include "payload.h"
void button_init(int pin); void button_init(int pin);
void readButton(); void readButton();

View File

@ -1,31 +1,15 @@
#ifndef _CYCLIC_H #ifndef _CYCLIC_H
#define _CYCLIC_H #define _CYCLIC_H
//#include <lmic.h>
#include "globals.h" #include "globals.h"
#include "senddata.h" #include "senddata.h"
#include "rcommand.h" #include "rcommand.h"
#include "spislave.h" #include "spislave.h"
#if(HAS_LORA)
#include <lmic.h>
#endif
#if (HAS_BME)
#include "bmesensor.h" #include "bmesensor.h"
#endif
#ifdef HAS_DISPLAY
#include "display.h" #include "display.h"
#endif
#if (HAS_SDS011)
#include "sds011read.h" #include "sds011read.h"
#endif
#if (HAS_SDCARD)
#include "sdcard.h" #include "sdcard.h"
#endif
extern Ticker housekeeper; extern Ticker housekeeper;

View File

@ -134,42 +134,4 @@ extern TimerHandle_t WifiChanTimer;
extern Timezone myTZ; extern Timezone myTZ;
extern RTC_DATA_ATTR runmode_t RTC_runmode; extern RTC_DATA_ATTR runmode_t RTC_runmode;
// application includes
#include "led.h"
#include "payload.h"
#include "blescan.h"
#include "power.h"
#if (HAS_GPS)
#include "gpsread.h"
#endif
#if (HAS_LORA)
#include "lorawan.h"
#endif
#ifdef HAS_DISPLAY
#include "display.h"
#endif
#ifdef HAS_MATRIX_DISPLAY
#include "ledmatrixdisplay.h"
#endif
#ifdef HAS_BUTTON
#include "button.h"
#endif
#ifdef HAS_ANTENNA_SWITCH
#include "antenna.h"
#endif
#if (HAS_SENSORS)
#include "sensor.h"
#endif
#if (HAS_BME)
#include "bmesensor.h"
#endif
#endif #endif

View File

@ -13,11 +13,13 @@
#define PMU_IRQ 0x200 #define PMU_IRQ 0x200
#include "globals.h" #include "globals.h"
#include "button.h"
#include "cyclic.h" #include "cyclic.h"
#include "senddata.h" #include "senddata.h"
#include "timekeeper.h" #include "timekeeper.h"
#include "bmesensor.h" #include "bmesensor.h"
#include "power.h" #include "power.h"
#include "ledmatrixdisplay.h"
void irqHandler(void *pvParameters); void irqHandler(void *pvParameters);
void mask_user_IRQ(); void mask_user_IRQ();

View File

@ -1,9 +1,8 @@
#ifndef _LED_H #ifndef _LED_H
#define _LED_H #define _LED_H
#ifdef HAS_RGB_LED
#include <SmartLeds.h> #include <SmartLeds.h>
#endif #include "lorawan.h"
// value for HSL color // value for HSL color
// see http://www.workwithcolor.com/blue-color-hue-range-01.htm // see http://www.workwithcolor.com/blue-color-hue-range-01.htm

View File

@ -3,6 +3,7 @@
#include "LEDMatrix.h" #include "LEDMatrix.h"
#include "ledmatrixfonts.h" #include "ledmatrixfonts.h"
#include "ledmatrixdisplay.h"
extern uint8_t MatrixDisplayIsOn; extern uint8_t MatrixDisplayIsOn;

View File

@ -8,6 +8,7 @@
#include "hash.h" #include "hash.h"
#include "senddata.h" #include "senddata.h"
#include "cyclic.h" #include "cyclic.h"
#include "led.h"
#define MAC_SNIFF_WIFI 0 #define MAC_SNIFF_WIFI 0
#define MAC_SNIFF_BLE 1 #define MAC_SNIFF_BLE 1

View File

@ -17,9 +17,8 @@
#include "ota.h" #include "ota.h"
#include "irqhandler.h" #include "irqhandler.h"
#include "spislave.h" #include "spislave.h"
#include "sensor.h"
#if (HAS_LORA)
#include "lorawan.h" #include "lorawan.h"
#endif
#include "timekeeper.h" #include "timekeeper.h"
#endif
#endif

View File

@ -4,7 +4,9 @@
#ifdef USE_OTA #ifdef USE_OTA
#include "globals.h" #include "globals.h"
#include <ss_oled.h> #include "led.h"
#include "display.h"
#include <Update.h> #include <Update.h>
#include <WiFi.h> #include <WiFi.h>
#include <WiFiClientSecure.h> #include <WiFiClientSecure.h>

View File

@ -1,11 +1,7 @@
#ifndef _PAYLOAD_H_ #ifndef _PAYLOAD_H_
#define _PAYLOAD_H_ #define _PAYLOAD_H_
#include "paxcounter.conf"
#if (HAS_SDS011)
#include "sds011read.h" #include "sds011read.h"
#endif
// MyDevices CayenneLPP 1.0 channels for Synamic sensor payload format // MyDevices CayenneLPP 1.0 channels for Synamic sensor payload format
// all payload goes out on LoRa FPort 1 // all payload goes out on LoRa FPort 1

View File

@ -4,6 +4,7 @@
#include <Arduino.h> #include <Arduino.h>
#include <driver/adc.h> #include <driver/adc.h>
#include <esp_adc_cal.h> #include <esp_adc_cal.h>
#include "i2c.h" #include "i2c.h"
#include "reset.h" #include "reset.h"

View File

@ -1,20 +1,19 @@
#ifndef _RCOMMAND_H #ifndef _RCOMMAND_H
#define _RCOMMAND_H #define _RCOMMAND_H
#include <rom/rtc.h>
#include "senddata.h" #include "senddata.h"
#include "cyclic.h" #include "cyclic.h"
#include "configmanager.h" #include "configmanager.h"
#if(HAS_LORA)
#include "lorawan.h" #include "lorawan.h"
#endif #include "sensor.h"
#include "macsniff.h" #include "macsniff.h"
#include "wifiscan.h" #include "wifiscan.h"
#include <rom/rtc.h>
#include "cyclic.h" #include "cyclic.h"
#include "timekeeper.h" #include "timekeeper.h"
#if(TIME_SYNC_LORASERVER)
#include "timesync.h" #include "timesync.h"
#endif #include "blescan.h"
// table of remote commands and assigned functions // table of remote commands and assigned functions
typedef struct { typedef struct {

View File

@ -3,7 +3,11 @@
#include <driver/rtc_io.h> #include <driver/rtc_io.h>
#include <rom/rtc.h> #include <rom/rtc.h>
#include "i2c.h" #include "i2c.h"
#include "lorawan.h"
#include "display.h"
#include "power.h"
void do_reset(bool warmstart); void do_reset(bool warmstart);
void do_after_reset(int reason); void do_after_reset(int reason);

View File

@ -1,11 +1,12 @@
#ifndef _RTCTIME_H #ifndef _RTCTIME_H
#define _RTCTIME_H #define _RTCTIME_H
#include "globals.h"
#include "timekeeper.h"
#include <Wire.h> // must be included here so that Arduino library object file references work #include <Wire.h> // must be included here so that Arduino library object file references work
#include <RtcDS3231.h> #include <RtcDS3231.h>
#include "globals.h"
#include "timekeeper.h"
extern RtcDS3231<TwoWire> Rtc; // make RTC instance globally available extern RtcDS3231<TwoWire> Rtc; // make RTC instance globally available
uint8_t rtc_init(void); uint8_t rtc_init(void);

View File

@ -3,10 +3,11 @@
#include <globals.h> #include <globals.h>
#include <stdio.h> #include <stdio.h>
#include <SPI.h> #include <SPI.h>
#include <mySD.h> #include <mySD.h>
#include "sds011read.h"
#define SDCARD_FILE_NAME "paxcount.%02d" #define SDCARD_FILE_NAME "paxcount.%02d"
#define SDCARD_FILE_HEADER "date, time, wifi, bluet" #define SDCARD_FILE_HEADER "date, time, wifi, bluet"

View File

@ -1,8 +1,8 @@
#ifndef _SDS011READ_H #ifndef _SDS011READ_H
#define _SDS011READ_H #define _SDS011READ_H
#include "globals.h"
#include <SDS011.h> #include <SDS011.h>
#include "globals.h"
#define SDCARD_FILE_HEADER_SDS011 ", PM10,PM25" #define SDCARD_FILE_HEADER_SDS011 ", PM10,PM25"

View File

@ -3,18 +3,10 @@
#include "spislave.h" #include "spislave.h"
#include "cyclic.h" #include "cyclic.h"
#include "sensor.h"
#if(HAS_LORA)
#include "lorawan.h" #include "lorawan.h"
#endif
#ifdef HAS_DISPLAY
#include "display.h" #include "display.h"
#endif
#ifdef HAS_SDCARD
#include "sdcard.h" #include "sdcard.h"
#endif
extern Ticker sendcycler; extern Ticker sendcycler;

View File

@ -25,6 +25,7 @@ licenses. Refer to LICENSE.txt file in repository for more details.
#define _SPISLAVE_H #define _SPISLAVE_H
#include "globals.h" #include "globals.h"
#include "rcommand.h"
esp_err_t spi_init(); esp_err_t spi_init();

View File

@ -6,16 +6,9 @@
#include "TimeLib.h" #include "TimeLib.h"
#include "irqhandler.h" #include "irqhandler.h"
#include "timesync.h" #include "timesync.h"
#if (HAS_GPS)
#include "gpsread.h" #include "gpsread.h"
#endif
#ifdef HAS_IF482
#include "if482.h" #include "if482.h"
#elif defined HAS_DCF77
#include "dcf77.h" #include "dcf77.h"
#endif
extern const char timeSetSymbols[]; extern const char timeSetSymbols[];
extern Ticker timesyncer; extern Ticker timesyncer;

View File

@ -240,4 +240,4 @@ std::array<uint32_t, 1683> vendors = {
0xb84fd5, 0xc0eefb, 0x206e9c, 0x6c2f2c, 0x18227e, 0x30c7ae, 0x501ac5, 0xb84fd5, 0xc0eefb, 0x206e9c, 0x6c2f2c, 0x18227e, 0x30c7ae, 0x501ac5,
0x6045bd, 0x1cb094, 0xe85b5b, 0x0025ae, 0x001dd8, 0x000a75, 0xa4c939, 0x6045bd, 0x1cb094, 0xe85b5b, 0x0025ae, 0x001dd8, 0x000a75, 0xa4c939,
0xc0dcda, 0x04b429, 0x48794d, 0xc0dcda, 0x04b429, 0x48794d,
}; };

View File

@ -3,13 +3,17 @@
// ESP32 Functions // ESP32 Functions
#include <esp_wifi.h> #include <esp_wifi.h>
#include <esp_coexist.h>
#include "coexist_internal.h"
// Hash function for scrambling MAC addresses #include "hash.h" // Hash function for scrambling MAC addresses
#include "hash.h" #include "antenna.h" // code for switching wifi antennas
#include "macsniff.h"
void wifi_sniffer_init(void); void wifi_sniffer_init(void);
void switch_wifi_sniffer (uint8_t state); void switch_wifi_sniffer(uint8_t state);
void IRAM_ATTR wifi_sniffer_packet_handler(void *buff, wifi_promiscuous_pkt_type_t type); void IRAM_ATTR wifi_sniffer_packet_handler(void *buff,
wifi_promiscuous_pkt_type_t type);
void switchWifiChannel(TimerHandle_t xTimer); void switchWifiChannel(TimerHandle_t xTimer);
#endif #endif

View File

@ -1,6 +1,5 @@
/* code snippets taken from // some code snippets taken from
https://github.com/nkolban/esp32-snippets/tree/master/BLE/scanner // https://github.com/nkolban/esp32-snippets/tree/master/BLE/scanner
*/
#include "blescan.h" #include "blescan.h"

View File

@ -1,6 +1,7 @@
/* configmanager persists runtime configuration using NVRAM of ESP32*/ /* configmanager persists runtime configuration using NVRAM of ESP32*/
#include "globals.h" #include "globals.h"
#include "configmanager.h"
// Local logging tag // Local logging tag
static const char TAG[] = "flash"; static const char TAG[] = "flash";

View File

@ -1,6 +1,7 @@
#if (HAS_GPS) #if (HAS_GPS)
#include "globals.h" #include "globals.h"
#include "gpsread.h"
// Local logging tag // Local logging tag
static const char TAG[] = __FILE__; static const char TAG[] = __FILE__;

View File

@ -1,6 +1,7 @@
#ifdef HAS_MATRIX_DISPLAY #ifdef HAS_MATRIX_DISPLAY
#include "globals.h" #include "globals.h"
#include "ledmatrixdisplay.h"
#define MATRIX_DISPLAY_PAGES (2) // number of display pages #define MATRIX_DISPLAY_PAGES (2) // number of display pages
#define LINE_DIAGRAM_DIVIDER (2) // scales pax numbers to led rows #define LINE_DIAGRAM_DIVIDER (2) // scales pax numbers to led rows

View File

@ -1,6 +1,7 @@
// Basic Config // Basic Config
#include "globals.h" #include "globals.h"
#include "macsniff.h
#if (VENDORFILTER) #if (VENDORFILTER)
#include "vendor_array.h" #include "vendor_array.h"

View File

@ -1,5 +1,6 @@
// Basic Config // Basic Config
#include "globals.h" #include "globals.h"
#include "sensor.h"
// Local logging tag // Local logging tag
static const char TAG[] = __FILE__; static const char TAG[] = __FILE__;

View File

@ -1,5 +1,4 @@
#include "timekeeper.h" #include "timekeeper.h"
#include "paxcounter.conf"
#if !(HAS_LORA) #if !(HAS_LORA)
#if (TIME_SYNC_LORASERVER) #if (TIME_SYNC_LORASERVER)

View File

@ -13,8 +13,6 @@ accept this.
*/ */
#if (HAS_LORA)
#if (TIME_SYNC_LORASERVER) && (TIME_SYNC_LORAWAN) #if (TIME_SYNC_LORASERVER) && (TIME_SYNC_LORAWAN)
#error Duplicate timesync method selected. You must select either LORASERVER or LORAWAN timesync. #error Duplicate timesync method selected. You must select either LORASERVER or LORAWAN timesync.
#endif #endif
@ -274,6 +272,4 @@ Exit:
// inform processing task // inform processing task
xTaskNotify(timeSyncProcTask, (rc ? rcv_seqNo : TIME_SYNC_END_FLAG), xTaskNotify(timeSyncProcTask, (rc ? rcv_seqNo : TIME_SYNC_END_FLAG),
eSetBits); eSetBits);
} }
#endif // HAS_LORA

View File

@ -1,8 +1,6 @@
// Basic Config // Basic Config
#include "globals.h" #include "globals.h"
#include "wifiscan.h" #include "wifiscan.h"
#include <esp_coexist.h>
#include "coexist_internal.h"
// Local logging tag // Local logging tag
static const char TAG[] = "wifi"; static const char TAG[] = "wifi";