Skip to content

Commit 3698b5d

Browse files
committed
Compile commands for Sonar
Signed-off-by: Sara Damiano <sdamiano@stroudcenter.org>
1 parent 7a1c63a commit 3698b5d

File tree

2 files changed

+104
-72
lines changed

2 files changed

+104
-72
lines changed

docs/FAQ/Developer-Setup.md

Lines changed: 96 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ Set your platformio.ini configuration file up like this:
2121

2222
[platformio]
2323
description = ModularSensors Library
24-
; Pick your default environment, if you don't want to build all of them every time
24+
; Pick your default environment, if you have more than one and don't want to build all of them every time
2525
default_envs = mayfly
26-
; Whatever code you personally want to test from
26+
; Set the director for the code you want to test from
2727
src_dir = your_directory/your_source_code
2828

2929
[env]
@@ -33,107 +33,131 @@ framework = arduino
3333
; To run code checks; cppcheck and clangtidy must be installed
3434
check_tool = cppcheck, clangtidy
3535
check_patterns =
36-
src
37-
extras
38-
examples
36+
src
37+
extras
38+
examples
3939
check_flags =
40-
cppcheck: --enable=all, --inline-suppr
41-
clangtidy: --checks=-*
40+
cppcheck: --enable=all, --inline-suppr
41+
clangtidy: --checks=-*
4242
; deep search for dependencies, evalulating preprocessor conditionals
4343
lib_ldf_mode = deep+
4444
; look for the library director
4545
lib_extra_dirs = .
4646
; We have to ignore these folders or PlatformIO will double count all the dependencies
4747
lib_ignore =
48-
.git
49-
.pio
50-
.vscode
51-
doc
52-
examples
53-
sensor_tests
48+
.git
49+
.pio
50+
.vscode
51+
doc
52+
examples
53+
sensor_tests
5454
extras
55-
Adafruit NeoPixel
56-
Adafruit GFX Library
57-
Adafruit SSD1306
58-
Adafruit ADXL343
59-
Adafruit STMPE610
60-
Adafruit TouchScreen
61-
Adafruit ILI9341
55+
Adafruit NeoPixel
56+
Adafruit GFX Library
57+
Adafruit SSD1306
58+
Adafruit ADXL343
59+
Adafruit STMPE610
60+
Adafruit TouchScreen
61+
Adafruit ILI9341
6262
; All these library dependencies must be listed out since we're in the library
6363
; source code and won't read the dependencies from the library.json like a
6464
; typical user would
6565
lib_deps =
66-
envirodiy/EnviroDIY_DS3231
67-
arduino-libraries/RTCZero
68-
greygnome/EnableInterrupt
69-
greiman/SdFat
70-
vshymanskyy/TinyGSM
71-
knolleary/PubSubClient
72-
adafruit/Adafruit BusIO
73-
adafruit/Adafruit Unified Sensor
74-
https://github.com/soligen2010/Adafruit_ADS1X15.git
75-
adafruit/Adafruit AM2315
76-
adafruit/Adafruit BME280 Library
77-
adafruit/DHT sensor library
78-
adafruit/Adafruit INA219
79-
adafruit/Adafruit MPL115A2
80-
paulstoffregen/OneWire
81-
milesburton/DallasTemperature
82-
envirodiy/SDI-12
83-
northernwidget/MS5803
84-
https://github.com/EnviroDIY/Tally_Library.git#Dev_I2C
85-
envirodiy/SensorModbusMaster
86-
envirodiy/KellerModbus
87-
envirodiy/YosemitechModbus
88-
vshymanskyy/StreamDebugger
89-
; The directories for the source code
66+
envirodiy/EnviroDIY_DS3231
67+
arduino-libraries/RTCZero
68+
greygnome/EnableInterrupt
69+
greiman/SdFat
70+
vshymanskyy/TinyGSM
71+
knolleary/PubSubClient
72+
adafruit/Adafruit BusIO
73+
adafruit/Adafruit Unified Sensor
74+
https://github.com/soligen2010/Adafruit_ADS1X15.git
75+
adafruit/Adafruit AM2315
76+
adafruit/Adafruit BME280 Library
77+
adafruit/DHT sensor library
78+
adafruit/Adafruit INA219
79+
adafruit/Adafruit MPL115A2
80+
adafruit/Adafruit SHT4x Library
81+
https://github.com/MartinL1/BMP388_DEV
82+
paulstoffregen/OneWire
83+
milesburton/DallasTemperature
84+
envirodiy/SDI-12
85+
northernwidget/MS5803
86+
https://github.com/EnviroDIY/Tally_Library.git#Dev_I2C
87+
envirodiy/SensorModbusMaster
88+
envirodiy/KellerModbus
89+
envirodiy/YosemitechModbus
90+
vshymanskyy/StreamDebugger
91+
; The directories for the ModularSensors library source code
9092
src_filter =
91-
+<*>
92-
+<../../src>
93-
+<../../src/sensors>
94-
+<../../src/publishers>
95-
+<../../src/modems>
96-
+<../../src/WatchDogs>
97-
+<../../src/clocks>
98-
+<../../src/utils>
93+
+<*>
94+
+<../../src>
95+
+<../../src/sensors>
96+
+<../../src/publishers>
97+
+<../../src/modems>
98+
+<../../src/WatchDogs>
99+
+<../../src/clocks>
100+
+<../../src/utils>
99101
; Some common build flags
100102
build_flags =
101-
-D SDI12_EXTERNAL_PCINT
102-
-D NEOSWSERIAL_EXTERNAL_PCINT
103-
-D MQTT_MAX_PACKET_SIZE=240
104-
-D TINY_GSM_RX_BUFFER=64
105-
-D TINY_GSM_YIELD_MS=2
103+
-D SDI12_EXTERNAL_PCINT
104+
-D NEOSWSERIAL_EXTERNAL_PCINT
105+
-D MQTT_MAX_PACKET_SIZE=240
106+
-D TINY_GSM_RX_BUFFER=64
107+
-D TINY_GSM_YIELD_MS=2
108+
extra_scripts = pre:pioScripts/generate_compile_commands.py
106109

107110
[env:mayfly]
108-
upload_port = COM##
109-
monitor_port = COM##
111+
; Find your COM port, enter it here, and remove the semicolon at the start of the line
112+
; upload_port = COM##
113+
; monitor_port = COM##
110114
board = mayfly
111115
platform = atmelavr
112116
framework = arduino
113117
; You probably need some software serial libraries
114-
lib_deps = ${env.lib_deps}
115-
https://github.com/EnviroDIY/SoftwareSerial_ExternalInts.git
116-
https://github.com/PaulStoffregen/AltSoftSerial.git
117-
https://github.com/SRGDamia1/NeoSWSerial.git
118+
lib_deps =
119+
${env.lib_deps}
120+
https://github.com/EnviroDIY/SoftwareSerial_ExternalInts.git
121+
https://github.com/PaulStoffregen/AltSoftSerial.git
122+
https://github.com/SRGDamia1/NeoSWSerial.git
118123
; AVR boards need to ignore RTCZero, it's for SAMD only and will not compile for AVR
119-
lib_ignore = ${env.lib_ignore}, RTCZero
124+
lib_ignore =
125+
${env.lib_ignore}
126+
RTCZero
127+
Adafruit Zero DMA Library
128+
; Any extra build flags you want
129+
build_flags =
130+
${env.build_flags}
131+
-D STANDARD_SERIAL_OUTPUT=Serial
132+
-D DEBUGGING_SERIAL_OUTPUT=Serial
133+
-D DEEP_DEBUGGING_SERIAL_OUTPUT=Serial
134+
; when I'm uploading frequently, I disable verification of the write
135+
upload_flags =
136+
-V
120137

121138

122139
[env:adafruit_feather_m0]
123-
upload_port = COM##
124-
monitor_port = COM##
140+
; Find your COM port, enter it here, and remove the semicolon at the start of the line
141+
; upload_port = COM##
142+
; monitor_port = COM##
125143
platform = atmelsam
126144
board = adafruit_feather_m0
127145
framework = arduino
128146
; SAMD boards need RTCZero for the real time clock and sleeping
129-
lib_deps = ${env.lib_deps}
130-
RTCZero
147+
lib_deps =
148+
${env.lib_deps}
149+
RTCZero
131150
; Most of the software serial libraries won't compile.
132151
; Use the SERCOM's; they're better anyway
133-
lib_ignore = ${env.lib_ignore}
134-
SoftwareSerial_ExtInts
135-
AltSoftSerial
136-
NeoSWSerial
152+
lib_ignore =
153+
${env.lib_ignore}
154+
SoftwareSerial_ExtInts
155+
AltSoftSerial
156+
NeoSWSerial
157+
SoftwareWire
158+
build_flags =
159+
${env.build_flags}
160+
build_unflags = -D USE_TINYUSB
137161
```
138162

139163
While you're working on development, there is *extensive* debugging text built into this library.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import os
2+
Import("env")
3+
4+
# include toolchain paths
5+
env.Replace(COMPILATIONDB_INCLUDE_TOOLCHAIN=True)
6+
7+
# override compilation DB path
8+
env.Replace(COMPILATIONDB_PATH=os.path.join("$PROJECT_DIR/.vscode", "compile_commands.json"))

0 commit comments

Comments
 (0)