Skip to content

Commit 14b0e61

Browse files
authored
Merge pull request #637 from LeeLeahy2/update-makefile
Update makefile, fix builds with defines commented out, add testing scripts
2 parents 930848b + 067bebb commit 14b0e61

File tree

11 files changed

+410
-33
lines changed

11 files changed

+410
-33
lines changed

Firmware/RTK_Everywhere/Developer.ino

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,10 @@ void espnowProcessRTCM(byte incoming) {}
184184
esp_err_t espnowRemovePeer(uint8_t *peerMac) {return ESP_OK;}
185185
esp_err_t espnowSendPairMessage(uint8_t *sendToMac) {return ESP_OK;}
186186
bool espnowSetChannel(uint8_t channelNumber) {return false;}
187-
void espnowStart() {}
187+
bool espNowStart() {return false;}
188188
#define ESPNOW_START() false
189189
void espnowStaticPairing() {}
190-
void espnowStop() {}
190+
bool espNowStop() {return true;}
191191
#define ESPNOW_STOP() true
192192
void updateEspnow() {}
193193

@@ -207,7 +207,7 @@ uint32_t wifiGetStartTimeout() {return 0;}
207207
int wifiNetworkCount() {return 0;}
208208
void wifiResetThrottleTimeout() {}
209209
void wifiResetTimeout() {}
210-
#define WIFI_SOFT_AP_RUNNING() {return false;}
210+
#define WIFI_SOFT_AP_RUNNING() false
211211
bool wifiStart() {return false;}
212212
bool wifiStationIsRunning() {return false;}
213213
#define WIFI_STOP() {}
@@ -276,7 +276,10 @@ void pointperfectPrintKeyInformation(const char *requestedBy) {systemPrintln("**
276276

277277
#ifndef COMPILE_LG290P
278278

279+
void lg290pBoot() {}
279280
void lg290pHandler(uint8_t * buffer, int length) {}
281+
bool lg290pMessageEnabled(char *nmeaSentence, int sentenceLength) {return false;}
282+
void lg290pReset() {}
280283

281284
#endif // COMPILE_LG290P
282285

Firmware/RTK_Everywhere/GNSS_LG290P.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2197,8 +2197,6 @@ void GNSS_LG290P::update()
21972197
// We don't check serial data here; the gnssReadTask takes care of serial consumption
21982198
}
21992199

2200-
#endif // COMPILE_LG290P
2201-
22022200
//----------------------------------------
22032201
void lg290pBoot()
22042202
{
@@ -2262,3 +2260,5 @@ bool lg290pMessageEnabled(char *nmeaSentence, int sentenceLength)
22622260
// If we can't ID this message, allow it by default. The device configuration should control most message flow.
22632261
return (true);
22642262
}
2263+
2264+
#endif // COMPILE_LG290P

Firmware/RTK_Everywhere/Network.ino

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,6 @@ NETWORK_POLL_SEQUENCE *networkSequence[NETWORK_OFFLINE];
131131

132132
NetMask_t networkMdnsRunning; // Non-zero when mDNS is running
133133

134-
extern bool restartWiFi; // From WiFi.ino
135-
136134
//----------------------------------------
137135
// Menu for configuring TCP/UDP interfaces
138136
//----------------------------------------

Firmware/RTK_Everywhere/RTK_Everywhere.ino

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,14 @@
3131
#define COMPILE_ESPNOW // Requires WiFi. Comment out to remove ESP-Now functionality.
3232
#endif // COMPILE_WIFI
3333

34+
#define COMPILE_LG290P // Comment out to remove LG290P functionality
35+
#define COMPILE_MOSAICX5 // Comment out to remove mosaic-X5 functionality
36+
#define COMPILE_UM980 // Comment out to remove UM980 functionality
3437
#define COMPILE_ZED // Comment out to remove ZED-F9x functionality
38+
39+
#ifdef COMPILE_ZED
3540
#define COMPILE_L_BAND // Comment out to remove L-Band functionality
36-
#define COMPILE_UM980 // Comment out to remove UM980 functionality
37-
#define COMPILE_MOSAICX5 // Comment out to remove mosaic-X5 functionality
38-
#define COMPILE_LG290P // Comment out to remove LG290P functionality
41+
#endif // COMPILE_ZED
3942

4043
#define COMPILE_IM19_IMU // Comment out to remove IM19_IMU functionality
4144
#define COMPILE_POINTPERFECT_LIBRARY // Comment out to remove PPL support
@@ -317,6 +320,8 @@ RTK_WIFI wifi(false);
317320
}
318321
#endif // COMPILE_WIFI
319322

323+
bool restartWiFi = false; // Restart WiFi if user changes anything
324+
320325
#define MQTT_CLIENT_STOP(shutdown) \
321326
{ \
322327
if (settings.debugNetworkLayer || settings.debugMqttClientState) \
@@ -1503,7 +1508,7 @@ void logUpdate()
15031508
if (logFileSize > 0)
15041509
{
15051510
lastFileReport = millis();
1506-
1511+
15071512
if (settings.enablePrintLogFileStatus)
15081513
{
15091514
systemPrintf("Log file size: %lld", logFileSize);

Firmware/RTK_Everywhere/WiFi.ino

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -412,12 +412,6 @@ const int wifiStartNamesEntries = sizeof(wifiStartNames) / sizeof(wifiStartNames
412412
const char * wifiSoftApSsid = "RTK Config";
413413
const char * wifiSoftApPassword = nullptr;
414414

415-
//****************************************
416-
// Globals
417-
//****************************************
418-
419-
bool restartWiFi = false; // Restart WiFi if user changes anything
420-
421415
//****************************************
422416
// Locals
423417
//****************************************

Firmware/RTK_Everywhere/check.sh

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
#!/bin/bash
2+
#
3+
# check.sh
4+
# Script to modify RTK_Everywhere.ino to comment out various defines
5+
# and verify that the code still builds successfully. This script
6+
# stops execution upon error due to the following command.
7+
########################################################################
8+
set -e
9+
#set -o verbose
10+
#set -o xtrace
11+
12+
# Start fresh
13+
git reset --hard --quiet HEAD
14+
make
15+
16+
# Bluetooth
17+
sed -i 's|#define COMPILE_BT|//#define COMPILE_BT|' RTK_Everywhere.ino
18+
make
19+
git reset --hard --quiet HEAD
20+
21+
# Network
22+
sed -i 's|#define COMPILE_WIFI|//#define COMPILE_WIFI|' RTK_Everywhere.ino
23+
sed -i 's|#define COMPILE_ETHERNET|//#define COMPILE_ETHERNET|' RTK_Everywhere.ino
24+
sed -i 's|#define COMPILE_CELLULAR|//#define COMPILE_CELLULAR|' RTK_Everywhere.ino
25+
make
26+
git reset --hard --quiet HEAD
27+
28+
# Cellular
29+
sed -i 's|#define COMPILE_CELLULAR|//#define COMPILE_CELLULAR|' RTK_Everywhere.ino
30+
make
31+
git reset --hard --quiet HEAD
32+
33+
# Ethernet
34+
sed -i 's|#define COMPILE_ETHERNET|//#define COMPILE_ETHERNET|' RTK_Everywhere.ino
35+
make
36+
git reset --hard --quiet HEAD
37+
38+
# WiFi
39+
sed -i 's|#define COMPILE_WIFI|//#define COMPILE_WIFI|' RTK_Everywhere.ino
40+
make
41+
git reset --hard --quiet HEAD
42+
43+
# Soft AP
44+
sed -i 's|#define COMPILE_AP|//#define COMPILE_AP|' RTK_Everywhere.ino
45+
make
46+
git reset --hard --quiet HEAD
47+
48+
# ESPNOW
49+
sed -i 's|#define COMPILE_ESPNOW|//#define COMPILE_ESPNOW|' RTK_Everywhere.ino
50+
make
51+
git reset --hard --quiet HEAD
52+
53+
# WiFi, SOFT AP, ESPNOW
54+
sed -i 's|#define COMPILE_WIFI|//#define COMPILE_WIFI|' RTK_Everywhere.ino
55+
sed -i 's|#define COMPILE_AP|//#define COMPILE_AP|' RTK_Everywhere.ino
56+
sed -i 's|#define COMPILE_ESPNOW|//#define COMPILE_ESPNOW|' RTK_Everywhere.ino
57+
make
58+
git reset --hard --quiet HEAD
59+
60+
# LG290P
61+
sed -i 's|#define COMPILE_LG290P|//#define COMPILE_LG290P|' RTK_Everywhere.ino
62+
make
63+
git reset --hard --quiet HEAD
64+
65+
# MOSAIC X5
66+
sed -i 's|#define COMPILE_MOSAICX5|//#define COMPILE_MOSAICX5|' RTK_Everywhere.ino
67+
make
68+
git reset --hard --quiet HEAD
69+
70+
# UM980
71+
sed -i 's|#define COMPILE_UM980|//#define COMPILE_UM980|' RTK_Everywhere.ino
72+
make
73+
git reset --hard --quiet HEAD
74+
75+
# ZED F9P
76+
sed -i 's|#define COMPILE_ZED|//#define COMPILE_ZED|' RTK_Everywhere.ino
77+
make
78+
git reset --hard --quiet HEAD
79+
80+
# GNSS None
81+
sed -i 's|#define COMPILE_LG290P|//#define COMPILE_LG290P|' RTK_Everywhere.ino
82+
sed -i 's|#define COMPILE_MOSAICX5|//#define COMPILE_MOSAICX5|' RTK_Everywhere.ino
83+
sed -i 's|#define COMPILE_UM980|//#define COMPILE_UM980|' RTK_Everywhere.ino
84+
sed -i 's|#define COMPILE_ZED|//#define COMPILE_ZED|' RTK_Everywhere.ino
85+
make
86+
git reset --hard --quiet HEAD
87+
88+
# L-Band
89+
sed -i 's|#define COMPILE_L_BAND|//#define COMPILE_L_BAND|' RTK_Everywhere.ino
90+
make
91+
git reset --hard --quiet HEAD
92+
93+
# IM19_IMU
94+
sed -i 's|#define COMPILE_IM19_IMU|//#define COMPILE_IM19_IMU|' RTK_Everywhere.ino
95+
make
96+
git reset --hard --quiet HEAD
97+
98+
# PointPerfect Library
99+
sed -i 's|#define COMPILE_POINTPERFECT_LIBRARY|//#define COMPILE_POINTPERFECT_LIBRARY|' RTK_Everywhere.ino
100+
make
101+
git reset --hard --quiet HEAD
102+
103+
# BQ40Z50
104+
sed -i 's|#define COMPILE_BQ40Z50|//#define COMPILE_BQ40Z50|' RTK_Everywhere.ino
105+
make
106+
git reset --hard --quiet HEAD
107+
108+
# MQTT Client
109+
sed -i 's|#define COMPILE_MQTT_CLIENT|//#define COMPILE_MQTT_CLIENT|' RTK_Everywhere.ino
110+
make
111+
git reset --hard --quiet HEAD
112+
113+
# OTA Auto
114+
sed -i 's|#define COMPILE_OTA_AUTO|//#define COMPILE_OTA_AUTO|' RTK_Everywhere.ino
115+
make
116+
git reset --hard --quiet HEAD
117+
118+
# HTTP Client
119+
sed -i 's|#define COMPILE_HTTP_CLIENT|//#define COMPILE_HTTP_CLIENT|' RTK_Everywhere.ino
120+
make
121+
git reset --hard --quiet HEAD
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
#!/bin/bash
2+
#
3+
# check_branches.sh
4+
# Script to check various branches work with #defines compiled out.
5+
# Branches are listed in the file: check-branches.dat
6+
########################################################################
7+
#set -e
8+
#set -o verbose
9+
#set -o xtrace
10+
set -o pipefail
11+
12+
# Files
13+
data_file=check_branches.dat
14+
log_file=check_branches.log
15+
16+
# Remove the log file
17+
if [ -f "$log_file" ] ; then
18+
rm "$log_file"
19+
fi
20+
21+
# Get the starting and ending branches
22+
while read branch_name
23+
do
24+
if [[ -n "$start_branch" ]]
25+
then
26+
clear
27+
break;
28+
else
29+
start_branch=$branch_name
30+
fi
31+
end_branch=$branch_name
32+
done < $data_file
33+
34+
# Display the branches being checked
35+
echo "--------------------------------------------------------------------------------" 2>&1 | tee -a $log_file
36+
echo " Checking branches: $start_branch --> $end_branch" 2>&1 | tee -a $log_file
37+
date 2>&1 | tee -a $log_file
38+
echo "--------------------------------------------------------------------------------" 2>&1 | tee -a $log_file
39+
40+
# Walk the list of branches, log the output
41+
previous_branch=$start_branch
42+
while read branch_name
43+
do
44+
./check_named_branch.sh $branch_name 2>&1 | tee -a $log_file
45+
exit_status=$?
46+
if [ $exit_status -ne 0 ]; then
47+
if [ "$previous_branch" != "$branch_name" ]; then
48+
# Display the verified commits
49+
echo "--------------------------------------------------------------------------------" 2>&1 | tee -a $log_file
50+
echo " Verified branches: $start_branch --> $previous_branch" 2>&1 | tee -a $log_file
51+
date 2>&1 | tee -a $log_file
52+
echo "--------------------------------------------------------------------------------" 2>&1 | tee -a $log_file
53+
while read branch
54+
do
55+
if [ "$branch" == "$branch_name" ]; then
56+
break;
57+
fi
58+
echo $branch 2>&1 | tee -a $log_file
59+
done < $data_file
60+
fi
61+
echo "--------------------------------------------------------------------------------" 2>&1 | tee -a $log_file
62+
echo "Error: Branch $branch_name failed!" 2>&1 | tee -a $log_file
63+
echo "--------------------------------------------------------------------------------" 2>&1 | tee -a $log_file
64+
echo "check_branches exiting with status: $exit_status" 2>&1 | tee -a $log_file
65+
exit $exit_status
66+
fi
67+
previous_branch=$branch_name
68+
done < $data_file
69+
70+
# Display the verified branches
71+
echo "--------------------------------------------------------------------------------" 2>&1 | tee -a $log_file
72+
echo " Verified branches" 2>&1 | tee -a $log_file
73+
date 2>&1 | tee -a $log_file
74+
echo "--------------------------------------------------------------------------------" 2>&1 | tee -a $log_file
75+
while read branch
76+
do
77+
echo $branch 2>&1 | tee -a $log_file
78+
done < $data_file
79+
80+
# Display the success message
81+
echo "--------------------------------------------------------------------------------" 2>&1 | tee -a $log_file
82+
echo " Successfully verified all branches $start_branch --> $end_branch" 2>&1 | tee -a $log_file
83+
date 2>&1 | tee -a $log_file
84+
echo "--------------------------------------------------------------------------------" 2>&1 | tee -a $log_file

0 commit comments

Comments
 (0)