#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
#define _BMESENSOR_H
#include "globals.h"
#include <Wire.h>
#include "globals.h"
#include "irqhandler.h"
#include "configmanager.h"
#ifdef HAS_BME680
#include <bsec.h>
#elif defined HAS_BME280

View File

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

View File

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

View File

@ -134,42 +134,4 @@ extern TimerHandle_t WifiChanTimer;
extern Timezone myTZ;
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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,11 +1,12 @@
#ifndef _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 <RtcDS3231.h>
#include "globals.h"
#include "timekeeper.h"
extern RtcDS3231<TwoWire> Rtc; // make RTC instance globally available
uint8_t rtc_init(void);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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