70
70
*/
71
71
public class ArduinoHelpers extends Common {
72
72
73
+ private static final String BUILD_PATH_SYSCALLS_SAM3 = "\" {build.path}/syscalls_sam3.c.o\" " ;
74
+ private static final String BUILD_PATH_ARDUINO_SYSCALLS_SAM3 = "\" {build.path}/arduino/syscalls_sam3.c.o\" " ;
75
+ private static final String BUILD_PATH_SYSCALLS_MTK = "\" {build.path}/syscalls_sam3.c.o\" " ;
76
+ private static final String BUILD_PATH_ARDUINO_SYSCALLS_MTK = "\" {build.path}/arduino/syscalls_sam3.c.o\" " ;
77
+
73
78
/**
74
79
* This method is the internal working class that adds the provided includepath to all configurations and languages.
75
80
*
@@ -559,6 +564,7 @@ private static void setTheEnvironmentVariablesSetTheDefaults(IContributedEnviron
559
564
contribEnv .addVariable (var , confDesc );
560
565
// End of Teensy specific settings
561
566
567
+
562
568
if (platformFile .segment (platformFile .segmentCount () - 2 ).equals ("avr" )) {
563
569
var = new EnvironmentVariable (ENV_KEY_compiler_path , makeEnvironmentVar ("A.RUNTIME.IDE.PATH" ) + "/hardware/tools/avr/bin/" );
564
570
contribEnv .addVariable (var , confDesc );
@@ -568,6 +574,9 @@ private static void setTheEnvironmentVariablesSetTheDefaults(IContributedEnviron
568
574
var = new EnvironmentVariable (ENV_KEY_build_generic_path , makeEnvironmentVar ("A.RUNTIME.IDE.PATH" )
569
575
+ "/hardware/tools/g++_arm_none_eabi/arm-none-eabi/bin" );
570
576
contribEnv .addVariable (var , confDesc );
577
+ } else if (platformFile .segment (platformFile .segmentCount () - 2 ).equals ("mtk" )) {
578
+ var = new EnvironmentVariable (ENV_KEY_build_system_path , makeEnvironmentVar ("A.RUNTIME.IDE.PATH" ) + "/hardware/arduino/mtk/system" );
579
+ contribEnv .addVariable (var , confDesc );
571
580
}
572
581
573
582
// some glue to make it work
@@ -638,9 +647,13 @@ private static void setTheEnvironmentVariablesAddthePlatformTxt(IContributedEnvi
638
647
if (RealData .length > 0 ) {
639
648
String Var [] = RealData [0 ].split ("=" , 2 ); // look for assignment
640
649
if (Var .length == 2 ) {
641
- String Value = MakeEnvironmentString (Var [1 ].replace ("\" {build.path}/syscalls_sam3.c.o\" " ,
642
- "\" {build.path}/arduino/syscalls_sam3.c.o\" " ));
643
- var = new EnvironmentVariable (MakeKeyString (Var [0 ]), Value );
650
+ String value = Var [1 ];
651
+ if (value .contains (BUILD_PATH_SYSCALLS_SAM3 )) {
652
+ value = MakeEnvironmentString (value .replace (BUILD_PATH_SYSCALLS_SAM3 , BUILD_PATH_ARDUINO_SYSCALLS_SAM3 ));
653
+ } else if (value .contains (BUILD_PATH_SYSCALLS_MTK )) {
654
+ value = MakeEnvironmentString (value .replace (BUILD_PATH_SYSCALLS_MTK , BUILD_PATH_ARDUINO_SYSCALLS_MTK ));
655
+ }
656
+ var = new EnvironmentVariable (MakeKeyString (Var [0 ]), value );
644
657
contribEnv .addVariable (var , confDesc );
645
658
}
646
659
}
0 commit comments