|
2 | 2 |
|
3 | 3 | import static org.junit.Assert.*;
|
4 | 4 |
|
5 |
| -import io.sloeber.core.api.Other; |
6 | 5 | import io.sloeber.providers.Arduino;
|
7 | 6 | import io.sloeber.providers.ESP8266;
|
8 | 7 | import io.sloeber.providers.MCUBoard;
|
|
14 | 13 | */
|
15 | 14 | @SuppressWarnings("nls")
|
16 | 15 | public class MySystem {
|
17 |
| - private static final String jantjesWindowsMachineHashKey = "1248215851"; |
18 |
| - //the one below is based on one mac address Fysiek adres (MAC): C0-3F-D5-66-04-58 |
19 |
| - private static final String jantjesWindowsMachineHashkeyAfterUpdate="139705674"; |
20 |
| - private static final String jantjesLinuxMachineHashKey = "88937904"; |
21 |
| - private static final String jantjeWindowsMachineHashkeyAfterSecondUpdate="-441525448"; |
| 16 | + private static final String jantjesWindowsMachine = "1248215851"; |
| 17 | + //the one below is based on one mac address Fysiek adres (MAC): C0-3F-D5-66-04-58 |
| 18 | + private static final String jantjesLinuxMachine = "88937904"; |
| 19 | + private static final String currentMachine = jantjesWindowsMachine; |
22 | 20 |
|
23 |
| - public static String getTeensyPlatform() { |
24 |
| - switch (Other.getSystemHash()) { |
25 |
| - case jantjesWindowsMachineHashKey: |
26 |
| - case jantjesWindowsMachineHashkeyAfterUpdate: |
27 |
| - case jantjeWindowsMachineHashkeyAfterSecondUpdate: |
28 |
| - return "E:\\arduino\\arduino-1.8.12 - teensy\\hardware\\teensy"; |
29 |
| - case jantjesLinuxMachineHashKey: |
30 |
| - return "/home/jan/tensyduino/arduino-1.8.12/hardware/teensy"; |
31 |
| - default: |
32 |
| - return new String(); |
33 |
| - } |
34 |
| - } |
| 21 | + public static String getTeensyPlatform() { |
| 22 | + switch (currentMachine) { |
| 23 | + case jantjesWindowsMachine: |
| 24 | + return "E:\\arduino\\arduino-1.8.12 - teensy\\hardware\\teensy"; |
| 25 | + case jantjesLinuxMachine: |
| 26 | + return "/home/jan/tensyduino/arduino-1.8.12/hardware/teensy"; |
| 27 | + default: |
| 28 | + return new String(); |
| 29 | + } |
| 30 | + } |
35 | 31 |
|
36 |
| - public static String getTeensyBoard_txt() { |
37 |
| - return getTeensyPlatform() + "/avr/boards.txt"; |
38 |
| - } |
39 |
| - public static MCUBoard[] getUploadBoards() { |
40 |
| - switch (Other.getSystemHash()) { |
41 |
| - case jantjesLinuxMachineHashKey: { |
42 |
| - MCUBoard[] boards = { |
43 |
| - Teensy.teensypp2("/dev/ttyACM0"), |
44 |
| - Arduino.leonardo("/dev/ttyS0"), //werkt niet |
45 |
| - Arduino.fried2016("/dev/ttyS0"), //werkt niet |
46 |
| - Arduino.zeroNatviePort("/dev/ttyS0"), //werkt niet |
47 |
| - Arduino.yun("COM20"), |
48 |
| - ESP8266.wemosD1("/dev/ttyUSB0"), |
49 |
| - Arduino.arduino_101("COM15"), |
50 |
| - Arduino.zeroProgrammingPort("COM14"), |
51 |
| - Arduino.getMega2560Board("COM11"), |
52 |
| - Arduino.dueprogramming("COM8"), |
53 |
| - Arduino.uno("COM6"), |
54 |
| - }; |
55 |
| - return boards; |
56 |
| - } |
57 |
| - case jantjesWindowsMachineHashKey: |
58 |
| - case jantjeWindowsMachineHashkeyAfterSecondUpdate: |
59 |
| - case jantjesWindowsMachineHashkeyAfterUpdate:{ |
60 |
| - //due native upload gives to mutch trouble even in arduino IDE |
61 |
| - MCUBoard[] boards = { |
62 |
| - Teensy.teensypp2("COM103"), |
63 |
| - // Teensy.Teensy3_1("COM24"), |
64 |
| - Arduino.leonardo("COM101"), |
65 |
| - Arduino.fried2016("COM102"), |
66 |
| - Arduino.zeroNatviePort("COM104"), //boardSponsor |
67 |
| - Arduino.yun("COM106"), |
68 |
| - ESP8266.wemosD1("COM108"), |
69 |
| - Arduino.arduino_101("COM110"), |
70 |
| - Arduino.zeroProgrammingPort("COM111"), |
71 |
| - Arduino.getMega2560Board("COM112"), |
72 |
| - Arduino.dueprogramming("COM124"), |
73 |
| - Arduino.uno("COM126"), |
74 |
| - }; |
75 |
| - return boards; |
76 |
| - } |
77 |
| - default: |
78 |
| - fail("Boards for the system with haskey " + Other.getSystemHash() + " are not found"); |
79 |
| - return null; |
80 |
| - } |
81 |
| - } |
| 32 | + public static String getTeensyBoard_txt() { |
| 33 | + return getTeensyPlatform() + "/avr/boards.txt"; |
| 34 | + } |
| 35 | + |
| 36 | + public static MCUBoard[] getUploadBoards() { |
| 37 | + switch (currentMachine) { |
| 38 | + case jantjesLinuxMachine: { |
| 39 | + MCUBoard[] boards = { Teensy.teensypp2("/dev/ttyACM0"), Arduino.leonardo("/dev/ttyS0"), //werkt niet |
| 40 | + Arduino.fried2016("/dev/ttyS0"), //werkt niet |
| 41 | + Arduino.zeroNatviePort("/dev/ttyS0"), //werkt niet |
| 42 | + Arduino.yun("COM20"), ESP8266.wemosD1("/dev/ttyUSB0"), Arduino.arduino_101("COM15"), |
| 43 | + Arduino.zeroProgrammingPort("COM14"), Arduino.getMega2560Board("COM11"), |
| 44 | + Arduino.dueprogramming("COM8"), Arduino.uno("COM6"), }; |
| 45 | + return boards; |
| 46 | + } |
| 47 | + case jantjesWindowsMachine: |
| 48 | + //due native upload gives to mutch trouble even in arduino IDE |
| 49 | + MCUBoard[] boards = { Teensy.teensypp2("COM103"), |
| 50 | + // Teensy.Teensy3_1("COM24"), |
| 51 | + Arduino.leonardo("COM101"), Arduino.fried2016("COM102"), Arduino.zeroNatviePort("COM104"), //boardSponsor |
| 52 | + Arduino.yun("COM106"), ESP8266.wemosD1("COM108"), Arduino.arduino_101("COM110"), |
| 53 | + Arduino.zeroProgrammingPort("COM111"), Arduino.getMega2560Board("COM112"), |
| 54 | + Arduino.dueprogramming("COM124"), Arduino.uno("COM126"), }; |
| 55 | + return boards; |
| 56 | + default: |
| 57 | + fail("Boards for the system with haskey " + currentMachine + " are not found"); |
| 58 | + return null; |
| 59 | + } |
| 60 | + } |
82 | 61 | }
|
0 commit comments