diff --git a/src/Flash.cpp b/src/Flash.cpp deleted file mode 100644 index 13a8c9d..0000000 --- a/src/Flash.cpp +++ /dev/null @@ -1,3 +0,0 @@ -#include "Flash.h" - - diff --git a/src/Gps.cpp b/src/Gps.cpp index ba05898..26585f7 100644 --- a/src/Gps.cpp +++ b/src/Gps.cpp @@ -1,9 +1,9 @@ +#include #include "Gps.h" #include "Config.h" #include "Hardware.h" #include "MainUnit.h" #include "Logging.h" -#include "math.h" #define LOGGER_NAME "Gps" diff --git a/src/Hardware.cpp b/src/Hardware.cpp index ac2197a..246cff2 100644 --- a/src/Hardware.cpp +++ b/src/Hardware.cpp @@ -1,13 +1,8 @@ -#include "Config.h" +#include #include "Hardware.h" -#include "config/Hardware.h" +#include "config/Pins.h" #include "Logging.h" -#include - -#include -#include - namespace hardware { #define LOGGER_NAME "Hardware::sim808" @@ -116,7 +111,7 @@ namespace hardware { namespace i2c { - E24 eeprom = E24(E24Size_t::E24_512K, E24_ADDRESS); + E24 eeprom = E24(E24_SIZE, E24_ADDRESS); uint8_t poweredCount = 0; void powerOn() { diff --git a/src/MainUnit.cpp b/src/MainUnit.cpp index 9f0f79b..58fbc51 100644 --- a/src/MainUnit.cpp +++ b/src/MainUnit.cpp @@ -1,7 +1,7 @@ #include "MainUnit.h" #include "Rtc.h" #include "Hardware.h" -#include "config/Hardware.h" +#include "config/Pins.h" #include "Logging.h" #define LOGGER_NAME "MainUnit" diff --git a/src/Network.cpp b/src/Network.cpp index d5f7d5b..0099c3a 100644 --- a/src/Network.cpp +++ b/src/Network.cpp @@ -1,9 +1,8 @@ -#include "Config.h" - #include "Network.h" #include "Hardware.h" #include "MainUnit.h" #include "Rtc.h" +#include "Config.h" #include "Logging.h" #define LOGGER_NAME "Network" diff --git a/src/Rtc.cpp b/src/Rtc.cpp index 60ed2e3..43e38ff 100644 --- a/src/Rtc.cpp +++ b/src/Rtc.cpp @@ -1,5 +1,5 @@ #include "Rtc.h" -#include "config/Hardware.h" +#include "config/Pins.h" #include "Hardware.h" #include "Logging.h" diff --git a/src/SdCard.cpp b/src/SdCard.cpp index c69eea7..88f6aa8 100644 --- a/src/SdCard.cpp +++ b/src/SdCard.cpp @@ -2,7 +2,7 @@ #if BACKUP_ENABLE_SDCARD #include "SdCard.h" -#include "config/Hardware.h" +#include "config/Pins.h" namespace hardware { namespace sdcard { diff --git a/src/config/Hardware.h b/src/config/Hardware.h index 0a3cf3c..e3c0d4b 100644 --- a/src/config/Hardware.h +++ b/src/config/Hardware.h @@ -1,24 +1,13 @@ /** - * Defines Arduino pins number connected to external systems. + * Defines external hardware parameters */ -#pragma once #include #include -#define SIM_RST 5 ///< SIM808 RESET -#define SIM_RX 6 ///< SIM808 RXD -#define SIM_TX 7 ///< SIM808 TXD -#define SIM_PWR 9 ///< SIM808 PWRKEY -#define SIM_STATUS 8 ///< SIM808 STATUS +#define E24_ADDRESS E24_DEFAULT_ADDR ///< I2C address of the 24xxx chip +#define E24_SIZE E24Size_t::E24_512K ///< 24xxx chip size -#define I2C_PWR A0 ///< Used to drive I2C power supply -#define SD_SS SS - -#define SIM_RI 2 ///< Interrupt pin connected to SIM RI. -#define RTC_WAKE 3 ///< Interrupt pin connected to DS3231 !INT/SQW - - -#define E24_ADDRESS E24_DEFAULT_ADDR ///< I2C address of the 24xxx chip +#define SIM808_BAUDRATE 4800 ///< Control the baudrate use to communicate with the SIM808 module #define SIM_SERIAL_TYPE SoftwareSerial ///< Type of variable that holds the Serial communication with SIM808 #define SIM_SERIAL SIM_SERIAL_TYPE(SIM_TX, SIM_RX) ///< Definition of the instance that holds the Serial communication with SIM808 \ No newline at end of file diff --git a/src/config/Main.h b/src/config/Main.h index 392f179..dc15095 100644 --- a/src/config/Main.h +++ b/src/config/Main.h @@ -1,9 +1,10 @@ #pragma once #include "System.h" -#include "Sleeps.h" +#include "Hardware.h" #include "Gps.h" #include "Network.h" +#include "Sleeps.h" #include "Alerts.h" /** diff --git a/src/config/Pins.h b/src/config/Pins.h new file mode 100644 index 0000000..52cb54c --- /dev/null +++ b/src/config/Pins.h @@ -0,0 +1,16 @@ +/** + * Defines Arduino pins number connected to external systems. + */ +#pragma once + +#define SIM_RST 5 ///< SIM808 RESET +#define SIM_RX 6 ///< SIM808 RXD +#define SIM_TX 7 ///< SIM808 TXD +#define SIM_PWR 9 ///< SIM808 PWRKEY +#define SIM_STATUS 8 ///< SIM808 STATUS + +#define I2C_PWR A0 ///< Used to drive I2C power supply +#define SD_SS SS + +#define SIM_RI 2 ///< Interrupt pin connected to SIM RI. +#define RTC_WAKE 3 ///< Interrupt pin connected to DS3231 !INT/SQW \ No newline at end of file diff --git a/src/config/System.h b/src/config/System.h index 8198a33..a8ec933 100644 --- a/src/config/System.h +++ b/src/config/System.h @@ -1,11 +1,5 @@ #pragma once -/** - \def SIM808_BAUDRATE - Control the baudrate use to communicate with the SIM808 module -*/ -#define SIM808_BAUDRATE 4800 - /** \def CONFIG_ADDR Address of the config block in the I2C EEPROM chip.