Skip to content

Commit ffdbd78

Browse files
Eric Bersetheberseth
Eric Berseth
authored andcommitted
Misc cleanup for tracker platform
1 parent 1f33b8a commit ffdbd78

File tree

3 files changed

+21
-55
lines changed

3 files changed

+21
-55
lines changed

src/EdgePlatform.cpp

-3
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ void EdgePlatform::init()
7777
uint8_t byte2 = info.features & 0xFF;
7878
uint8_t byte3 = info.features >> 8;
7979

80-
#if (PLATFORM_ID == PLATFORM_TRACKER)
8180
// Parse OTP area to determine module type
8281
switch (info.model) {
8382
case TRACKER_MODEL_BARE_SOM:
@@ -153,8 +152,6 @@ void EdgePlatform::init()
153152
currentLimit_ = Ilim::eILIM_3;
154153
}
155154

156-
#endif
157-
158155
// Flag the initialization as complete
159156
isInitialized_ = true;
160157
}

src/tracker.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,6 @@ void Tracker::enableIoCanPower(bool enable)
171171
int Tracker::initEsp32()
172172
{
173173
// ESP32 related GPIO
174-
#if (PLATFORM_ID == PLATFORM_TRACKER)
175174
pinMode(ESP32_BOOT_MODE_PIN, OUTPUT);
176175
digitalWrite(ESP32_BOOT_MODE_PIN, HIGH);
177176
pinMode(ESP32_PWR_EN_PIN, OUTPUT);
@@ -182,7 +181,7 @@ int Tracker::initEsp32()
182181
digitalWrite(ESP32_PWR_EN_PIN, LOW); // power off device
183182
pinMode(ESP32_CS_PIN, OUTPUT);
184183
digitalWrite(ESP32_CS_PIN, HIGH);
185-
#endif
184+
186185
return SYSTEM_ERROR_NONE;
187186
}
188187

src/tracker_config.h

+20-50
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
// Tracker platform
2323
//-----------------------------------------------------------------------------
2424

25-
#if ( (PLATFORM_ID != PLATFORM_TRACKER) )
25+
#if (PLATFORM_ID != PLATFORM_TRACKER)
2626
#error "Platform not supported"
2727
#endif
2828

@@ -56,67 +56,37 @@
5656
//
5757
// Pin and interface mapping
5858
//
59-
#if (PLATFORM_ID == PLATFORM_TRACKER)
60-
#define BMI_SPI_INTERFACE (SPI1)
61-
#define BMI_SPI_CS_PIN (SEN_CS)
62-
#define BMI_INT_PIN (SEN_INT)
63-
#endif
59+
#define BMI_SPI_INTERFACE (SPI1)
60+
#define BMI_SPI_CS_PIN (SEN_CS)
61+
#define BMI_INT_PIN (SEN_INT)
6462
#define BMI_INT_MODE (FALLING)
6563

6664
#define UBLOX_SPI_INTERFACE (SPI1)
67-
#if (PLATFORM_ID == PLATFORM_TRACKER)
68-
#define UBLOX_CS_PIN (GPS_CS)
69-
#define UBLOX_PWR_EN_PIN (GPS_PWR)
70-
#define UBLOX_RESETN_PIN (GPS_RST)
71-
#define UBLOX_TX_READY_MCU_PIN (GPS_INT)
72-
#endif
65+
#define UBLOX_CS_PIN (GPS_CS)
66+
#define UBLOX_PWR_EN_PIN (GPS_PWR)
67+
#define UBLOX_RESETN_PIN (GPS_RST)
68+
#define UBLOX_TX_READY_MCU_PIN (GPS_INT)
7369
#define UBLOX_TX_READY_GPS_PIN (14) // PIO 14 is EXTINT on GPS Module
7470

75-
#if (PLATFORM_ID == PLATFORM_TRACKER)
76-
#define QUECTEL_GNSS_I2C_INTERFACE (Wire1)
77-
#define QUECTEL_GNSS_PWR_EN_PIN (GPS_PWR)
78-
#define QUECTEL_GNSS_WAKEUP_PIN (GPS_RST)
79-
#endif
80-
8171
#define ESP32_SPI_INTERFACE (SPI1)
82-
#if (PLATFORM_ID == PLATFORM_TRACKER)
83-
#define ESP32_CS_PIN (WIFI_CS)
84-
#define ESP32_BOOT_MODE_PIN (WIFI_BOOT)
85-
#define ESP32_PWR_EN_PIN (WIFI_EN)
86-
#define ESP32_INT_PIN (WIFI_INT)
87-
#endif
72+
#define ESP32_CS_PIN (WIFI_CS)
73+
#define ESP32_BOOT_MODE_PIN (WIFI_BOOT)
74+
#define ESP32_PWR_EN_PIN (WIFI_EN)
75+
#define ESP32_INT_PIN (WIFI_INT)
8876

89-
#if (PLATFORM_ID == PLATFORM_TRACKER)
90-
#define MCP_CAN_SPI_INTERFACE (SPI1)
91-
#define MCP_CAN_PWR_EN_PIN (CAN_PWR)
92-
#define MCP_CAN_RESETN_PIN (CAN_RST)
93-
#define MCP_CAN_CS_PIN (CAN_CS)
94-
#define MCP_CAN_INT_PIN (CAN_INT)
95-
#define MCP_CAN_STBY_PIN (CAN_STBY)
96-
#endif
77+
#define MCP_CAN_SPI_INTERFACE (SPI1)
78+
#define MCP_CAN_PWR_EN_PIN (CAN_PWR)
79+
#define MCP_CAN_RESETN_PIN (CAN_RST)
80+
#define MCP_CAN_CS_PIN (CAN_CS)
81+
#define MCP_CAN_INT_PIN (CAN_INT)
82+
#define MCP_CAN_STBY_PIN (CAN_STBY)
9783

9884

9985
//
10086
// Tracker One Specifc IO
10187
//
10288
#define TRACKER_THERMISTOR (A0)
10389
#define TRACKER_USER_BUTTON (D1)
104-
#if (PLATFORM_ID == PLATFORM_TRACKER)
105-
#define TRACKER_GNSS_LOCK_LED (D2)
106-
#endif
107-
108-
#if (PLATFORM_ID == PLATFORM_TRACKER)
109-
//#define RTC_WDT_DISABLE // Optional define for Tracker
110-
#endif
111-
#define TRACKER_89503_THERMISTOR (A3)
112-
#define TRACKER_89503_USER_BUTTON (D2)
113-
#define TRACKER_89503_VIN_EN_PIN (NFC_PIN2)
114-
115-
#define TRACKER_89503_STS3X_I2C_INSTANCE (Wire)
116-
#define TRACKER_89503_STS3X_I2C_ADDR (0x4a)
117-
118-
#define TRACKER_89503_ADP8866_I2C_INSTANCE (Wire)
119-
#define TRACKER_89503_ADP8866_I2C_ADDR (0x27)
120-
#define TRACKER_89503_ADP8866_RESETN_PIN (NFC_PIN1)
90+
#define TRACKER_GNSS_LOCK_LED (D2)
12191

122-
//#define RTC_WDT_DISABLE
92+
//#define RTC_WDT_DISABLE // Optional define for Tracker

0 commit comments

Comments
 (0)