Skip to content

Commit 0c4036b

Browse files
author
jantje
committed
Only act when the configuration changed
1 parent feacad3 commit 0c4036b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

io.sloeber.core/src/io/sloeber/core/listeners/ConfigurationChangeListener.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
* for instance you can have a project with 2 configurations
66
* one for teensy
77
* one for arduino uno
8-
*
9-
*
8+
*
9+
*
1010
* when you use the spi library the library is a completely different library
1111
* this code takes care that you use the correct library when switching configuration
12-
*
12+
*
1313
*/
1414

1515
import org.eclipse.cdt.core.settings.model.CProjectDescriptionEvent;
@@ -91,8 +91,10 @@ public void run() {
9191
}
9292

9393
// We have a arduino project so we are safe.
94+
ICProjectDescription oldprojDesc = event.getOldCProjectDescription();
9495

95-
if (projDesc.getActiveConfiguration() != null) {
96+
if (!projDesc.getName().equals(oldprojDesc.getName())) {
97+
// only act upon switching configurations
9698

9799
Helpers.setTheEnvironmentVariables(projDesc.getProject(), projDesc.getActiveConfiguration(),
98100
(InternalBoardDescriptor) BoardDescriptor.makeBoardDescriptor(projDesc.getActiveConfiguration()));

0 commit comments

Comments
 (0)