diff --git a/app/src/cc/arduino/view/Event.java b/app/src/cc/arduino/view/Event.java new file mode 100644 index 000000000..4cc2cd278 --- /dev/null +++ b/app/src/cc/arduino/view/Event.java @@ -0,0 +1,57 @@ +/* + * This file is part of Arduino. + * + * Arduino is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * As a special exception, you may use this file as part of a free software + * library without restriction. Specifically, if other files instantiate + * templates or use macros or inline functions from this file, or you compile + * this file and link it with other files to produce an executable, this + * file does not by itself cause the resulting executable to be covered by + * the GNU General Public License. This exception does not however + * invalidate any other reasons why the executable file might be covered by + * the GNU General Public License. + * + * Copyright 2015 Arduino LLC (http://www.arduino.cc/) + */ + +package cc.arduino.view; + +import java.awt.event.ActionEvent; +import java.util.HashMap; +import java.util.Map; + +public class Event extends ActionEvent { + + private final Map payload; + + public Event(Object source, int id, String command) { + super(source, id, command); + this.payload = new HashMap(); + } + + public Map getPayload() { + return payload; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(super.toString()); + sb.append("\n").append(payload.toString()); + return sb.toString(); + } + +} diff --git a/app/src/cc/arduino/view/EventListener.java b/app/src/cc/arduino/view/EventListener.java new file mode 100644 index 000000000..9f73a6ff7 --- /dev/null +++ b/app/src/cc/arduino/view/EventListener.java @@ -0,0 +1,36 @@ +/* + * This file is part of Arduino. + * + * Arduino is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * As a special exception, you may use this file as part of a free software + * library without restriction. Specifically, if other files instantiate + * templates or use macros or inline functions from this file, or you compile + * this file and link it with other files to produce an executable, this + * file does not by itself cause the resulting executable to be covered by + * the GNU General Public License. This exception does not however + * invalidate any other reasons why the executable file might be covered by + * the GNU General Public License. + * + * Copyright 2015 Arduino LLC (http://www.arduino.cc/) + */ + +package cc.arduino.view; + +public interface EventListener { + + void eventHappened(Event event); + +} diff --git a/app/src/cc/arduino/view/ShowUncertifiedBoardWarning.java b/app/src/cc/arduino/view/ShowUncertifiedBoardWarning.java new file mode 100644 index 000000000..974608356 --- /dev/null +++ b/app/src/cc/arduino/view/ShowUncertifiedBoardWarning.java @@ -0,0 +1,59 @@ +/* + * This file is part of Arduino. + * + * Arduino is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * As a special exception, you may use this file as part of a free software + * library without restriction. Specifically, if other files instantiate + * templates or use macros or inline functions from this file, or you compile + * this file and link it with other files to produce an executable, this + * file does not by itself cause the resulting executable to be covered by + * the GNU General Public License. This exception does not however + * invalidate any other reasons why the executable file might be covered by + * the GNU General Public License. + * + * Copyright 2015 Arduino LLC (http://www.arduino.cc/) + */ + +package cc.arduino.view; + +import processing.app.Preferences; + +import java.awt.*; + +public class ShowUncertifiedBoardWarning implements Runnable { + + private final Frame parent; + + public ShowUncertifiedBoardWarning(Frame parent) { + this.parent = parent; + } + + @Override + public void run() { + UncertifiedBoardWarning uncertifiedBoardWarning = new UncertifiedBoardWarning(parent, new EventListener() { + @Override + public void eventHappened(cc.arduino.view.Event event) { + if (!"uncertified_board_warning_ok_pressed".equals(event.getActionCommand())) { + return; + } + Preferences.set("uncertifiedBoardWarning_dontShowMeAgain", event.getPayload().get("dontShowMeAgain").toString()); + } + }); + uncertifiedBoardWarning.setLocationRelativeTo(parent); + uncertifiedBoardWarning.setVisible(true); + } + +} diff --git a/app/src/cc/arduino/view/UncertifiedBoardWarning.form b/app/src/cc/arduino/view/UncertifiedBoardWarning.form new file mode 100644 index 000000000..90ea0a918 --- /dev/null +++ b/app/src/cc/arduino/view/UncertifiedBoardWarning.form @@ -0,0 +1,81 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/app/src/cc/arduino/view/UncertifiedBoardWarning.java b/app/src/cc/arduino/view/UncertifiedBoardWarning.java new file mode 100644 index 000000000..cd22a886f --- /dev/null +++ b/app/src/cc/arduino/view/UncertifiedBoardWarning.java @@ -0,0 +1,146 @@ +/* + * This file is part of Arduino. + * + * Arduino is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * As a special exception, you may use this file as part of a free software + * library without restriction. Specifically, if other files instantiate + * templates or use macros or inline functions from this file, or you compile + * this file and link it with other files to produce an executable, this + * file does not by itself cause the resulting executable to be covered by + * the GNU General Public License. This exception does not however + * invalidate any other reasons why the executable file might be covered by + * the GNU General Public License. + * + * Copyright 2015 Arduino LLC (http://www.arduino.cc/) + */ + +package cc.arduino.view; + +import javax.swing.*; +import java.awt.*; + +import static processing.app.I18n._; + +public class UncertifiedBoardWarning extends javax.swing.JDialog { + + private final EventListener listener; + + public UncertifiedBoardWarning(Frame parent, EventListener listener) { + super(parent); + initComponents(); + this.listener = listener; + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + jLabel1 = new javax.swing.JLabel(); + dontShowMeAgain = new javax.swing.JCheckBox(); + ok = new javax.swing.JButton(); + + setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + setTitle(_("Uncertified board")); + setModal(true); + setName("uncertifiedBoardWarning"); // NOI18N + setResizable(false); + + jLabel1.setText("" + _("This board comes from an uncertified manufacturer.") + "
" + _("We won't be able to provide any support if it doesn't work as expected.") + ""); + jLabel1.setVerticalAlignment(javax.swing.SwingConstants.TOP); + + dontShowMeAgain.setText("Don't show me again"); + dontShowMeAgain.setName("dontShowMeAgain"); // NOI18N + + ok.setText("OK"); + ok.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + okActionPerformed(evt); + } + }); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE) + .addGroup(layout.createSequentialGroup() + .addComponent(dontShowMeAgain) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 206, Short.MAX_VALUE) + .addComponent(ok, javax.swing.GroupLayout.PREFERRED_SIZE, 82, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addContainerGap()) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 87, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(dontShowMeAgain) + .addComponent(ok)) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + + pack(); + }//
//GEN-END:initComponents + + private void okActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okActionPerformed + Event event = new Event(evt.getSource(), evt.getID(), "uncertified_board_warning_ok_pressed"); + event.getPayload().put("dontShowMeAgain", dontShowMeAgain.isSelected()); + listener.eventHappened(event); + this.dispose(); + }//GEN-LAST:event_okActionPerformed + + /** + * @param args the command line arguments + */ + public static void main(String args[]) throws Exception { + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + /* Create and display the dialog */ + java.awt.EventQueue.invokeLater(new Runnable() { + public void run() { + UncertifiedBoardWarning dialog = new UncertifiedBoardWarning(new javax.swing.JFrame(), new EventListener() { + + @Override + public void eventHappened(Event event) { + System.out.println(event); + } + }); + dialog.addWindowListener(new java.awt.event.WindowAdapter() { + @Override + public void windowClosing(java.awt.event.WindowEvent e) { + System.exit(0); + } + }); + dialog.setVisible(true); + } + }); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JCheckBox dontShowMeAgain; + private javax.swing.JLabel jLabel1; + private javax.swing.JButton ok; + // End of variables declaration//GEN-END:variables +} diff --git a/app/src/processing/app/Editor.java b/app/src/processing/app/Editor.java index 8c7ec1db3..9d6151278 100644 --- a/app/src/processing/app/Editor.java +++ b/app/src/processing/app/Editor.java @@ -24,6 +24,9 @@ package processing.app; import cc.arduino.packages.MonitorFactory; +import cc.arduino.view.*; +import cc.arduino.view.Event; +import cc.arduino.view.EventListener; import com.jcraft.jsch.JSchException; import jssc.SerialPortException; @@ -944,15 +947,22 @@ public class Editor extends JFrame implements RunnerListener { class SerialMenuListener implements ActionListener { + private final Frame parent; private final String serialPort; + private final String warning; - public SerialMenuListener(String serialPort) { + public SerialMenuListener(Frame parent, String serialPort, String warning) { + this.parent = parent; this.serialPort = serialPort; + this.warning = warning; } public void actionPerformed(ActionEvent e) { selectSerialPort(serialPort); base.onBoardOrPortChange(); + if (warning != null && !Preferences.getBoolean("uncertifiedBoardWarning_dontShowMeAgain")) { + SwingUtilities.invokeLater(new ShowUncertifiedBoardWarning(parent)); + } } } @@ -1034,7 +1044,7 @@ public class Editor extends JFrame implements RunnerListener { String label = port.getLabel(); JCheckBoxMenuItem item = new JCheckBoxMenuItem(label, address.equals(selectedPort)); - item.addActionListener(new SerialMenuListener(address)); + item.addActionListener(new SerialMenuListener(this, address, port.getPrefs().get("warning"))); serialMenu.add(item); } diff --git a/app/src/processing/app/Sketch.java b/app/src/processing/app/Sketch.java index ed09492b6..2f142d01b 100644 --- a/app/src/processing/app/Sketch.java +++ b/app/src/processing/app/Sketch.java @@ -23,12 +23,16 @@ package processing.app; +import cc.arduino.packages.BoardPort; import cc.arduino.packages.Uploader; +import cc.arduino.view.*; import processing.app.debug.Compiler; import processing.app.debug.Compiler.ProgressListener; import processing.app.debug.RunnerException; +import processing.app.debug.TargetBoard; import processing.app.forms.PasswordAuthorizationDialog; import processing.app.helpers.OSUtils; +import processing.app.helpers.PreferencesMap; import processing.app.helpers.PreferencesMapException; import processing.app.packages.Library; @@ -1148,6 +1152,8 @@ public class Sketch { * @return null if compilation failed, main class name if not */ public String build(String buildPath, boolean verbose) throws RunnerException, PreferencesMapException { + useOriginalVidPidIfUncertified(); + // run the preprocessor editor.status.progressUpdate(20); @@ -1197,6 +1203,37 @@ public class Sketch { return success; } + private void useOriginalVidPidIfUncertified() { + BoardPort boardPort = BaseNoGui.getDiscoveryManager().find(PreferencesData.get("serial.port")); + if (boardPort == null) { + return; + } + TargetBoard targetBoard = BaseNoGui.getTargetBoard(); + if (targetBoard == null) { + return; + } + PreferencesMap boardPreferences = targetBoard.getPreferences(); + if (boardPreferences.containsKey("build.vid") && boardPreferences.containsKey("build.pid")) { + if (!boardPreferences.containsKey("backup.build.vid")) { + boardPreferences.put("backup.build.vid", boardPreferences.get("build.vid")); + boardPreferences.put("backup.build.pid", boardPreferences.get("build.pid")); + } + + if (boardPort.getPrefs().get("warning") != null) { + boardPreferences.put("build.vid", boardPort.getPrefs().get("vid")); + boardPreferences.put("build.pid", boardPort.getPrefs().get("pid")); + } else { + boardPreferences.put("build.vid", boardPreferences.get("backup.build.vid")); + boardPreferences.put("build.pid", boardPreferences.get("backup.build.pid")); + } + } + + if (boardPort.getPrefs().get("warning") != null && !Preferences.getBoolean("uncertifiedBoardWarning_dontShowMeAgain")) { + SwingUtilities.invokeLater(new ShowUncertifiedBoardWarning(editor)); + } + + + } protected boolean upload(String buildPath, String suggestedClassName, boolean usingProgrammer) throws Exception { diff --git a/arduino-core/src/cc/arduino/packages/discoverers/SerialDiscovery.java b/arduino-core/src/cc/arduino/packages/discoverers/SerialDiscovery.java index 10eff401c..2b91b2489 100644 --- a/arduino-core/src/cc/arduino/packages/discoverers/SerialDiscovery.java +++ b/arduino-core/src/cc/arduino/packages/discoverers/SerialDiscovery.java @@ -29,18 +29,27 @@ package cc.arduino.packages.discoverers; -import java.util.ArrayList; -import java.util.List; - +import cc.arduino.packages.BoardPort; +import cc.arduino.packages.Discovery; import processing.app.BaseNoGui; import processing.app.Platform; import processing.app.Serial; +import processing.app.debug.TargetBoard; import processing.app.helpers.PreferencesMap; -import cc.arduino.packages.BoardPort; -import cc.arduino.packages.Discovery; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import static processing.app.I18n._; public class SerialDiscovery implements Discovery { + static { + //makes transifex happy + _("Uncertified"); + } + @Override public List discovery() { Platform os = BaseNoGui.getPlatform(); @@ -51,16 +60,35 @@ public class SerialDiscovery implements Discovery { List ports = Serial.list(); for (String port : ports) { - String boardName = os.resolveDeviceAttachedTo(port, BaseNoGui.packages, devicesListOutput); - String label = port; - if (boardName != null) - label += " (" + boardName + ")"; + Map boardData = os.resolveDeviceAttachedTo(port, BaseNoGui.packages, devicesListOutput); + TargetBoard board = (TargetBoard) boardData.get("board"); BoardPort boardPort = new BoardPort(); boardPort.setAddress(port); boardPort.setProtocol("serial"); + + PreferencesMap prefs = new PreferencesMap(); + prefs.put("vid", boardData.get("vid").toString()); + prefs.put("pid", boardData.get("pid").toString()); + String warningKey = "vid." + boardData.get("vid").toString() + ".warning"; + String warning = board.getPreferences().get(warningKey); + prefs.put("warning", warning); + + String boardName = board.getName(); + String label = port; + if (boardName != null) { + if (warning != null) { + label += " (" + boardName + " - " + _(warning) + ")"; + } else { + label += " (" + boardName + ")"; + } + } boardPort.setBoardName(boardName); boardPort.setLabel(label); + + + boardPort.setPrefs(prefs); + res.add(boardPort); } return res; diff --git a/arduino-core/src/processing/app/Platform.java b/arduino-core/src/processing/app/Platform.java index 97f25aae6..3c46c095d 100644 --- a/arduino-core/src/processing/app/Platform.java +++ b/arduino-core/src/processing/app/Platform.java @@ -24,6 +24,7 @@ package processing.app; import static processing.app.I18n._; import java.io.File; +import java.util.HashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; @@ -135,7 +136,7 @@ public class Platform { } } - public String resolveDeviceAttachedTo(String serial, Map packages, String devicesListOutput) { + public Map resolveDeviceAttachedTo(String serial, Map packages, String devicesListOutput) { return null; } @@ -143,17 +144,21 @@ public class Platform { return null; } - protected String resolveDeviceByVendorIdProductId(Map packages, String readVIDPID) { + protected Map resolveDeviceByVendorIdProductId(Map packages, String readVIDPID) { for (TargetPackage targetPackage : packages.values()) { for (TargetPlatform targetPlatform : targetPackage.getPlatforms().values()) { for (TargetBoard board : targetPlatform.getBoards().values()) { - List vids = new LinkedList(board.getPreferences().subTree("vid").values()); + List vids = new LinkedList(board.getPreferences().subTree("vid", 1).values()); if (!vids.isEmpty()) { - List pids = new LinkedList(board.getPreferences().subTree("pid").values()); - for (int i = 0; i< vids.size(); i++) { + List pids = new LinkedList(board.getPreferences().subTree("pid", 1).values()); + for (int i = 0; i < vids.size(); i++) { String vidPid = vids.get(i) + "_" + pids.get(i); if (vidPid.toUpperCase().equals(readVIDPID)) { - return board.getName(); + Map boardData = new HashMap(); + boardData.put("board", board); + boardData.put("vid", vids.get(i)); + boardData.put("pid", pids.get(i)); + return boardData; } } } diff --git a/arduino-core/src/processing/app/helpers/PreferencesMap.java b/arduino-core/src/processing/app/helpers/PreferencesMap.java index 4d16e3e38..09a095447 100644 --- a/arduino-core/src/processing/app/helpers/PreferencesMap.java +++ b/arduino-core/src/processing/app/helpers/PreferencesMap.java @@ -222,12 +222,21 @@ public class PreferencesMap extends LinkedHashMap { * @return */ public PreferencesMap subTree(String parent) { + return subTree(parent, -1); + } + + public PreferencesMap subTree(String parent, int sublevels) { PreferencesMap res = new PreferencesMap(); parent += "."; int parentLen = parent.length(); for (String key : keySet()) { - if (key.startsWith(parent)) - res.put(key.substring(parentLen), get(key)); + if (key.startsWith(parent)) { + String newKey = key.substring(parentLen); + int keySubLevels = newKey.split("\\.").length; + if (sublevels == -1 || keySubLevels == sublevels) { + res.put(newKey, get(key)); + } + } } return res; } diff --git a/arduino-core/src/processing/app/linux/Platform.java b/arduino-core/src/processing/app/linux/Platform.java index b0ea0b0c9..57af15d15 100644 --- a/arduino-core/src/processing/app/linux/Platform.java +++ b/arduino-core/src/processing/app/linux/Platform.java @@ -129,7 +129,7 @@ public class Platform extends processing.app.Platform { } @Override - public String resolveDeviceAttachedTo(String serial, Map packages, String devicesListOutput) { + public Map resolveDeviceAttachedTo(String serial, Map packages, String devicesListOutput) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); Executor executor = new ExternalProcessExecutor(baos); diff --git a/arduino-core/src/processing/app/macosx/Platform.java b/arduino-core/src/processing/app/macosx/Platform.java index 21ee82e08..433c7b9e7 100644 --- a/arduino-core/src/processing/app/macosx/Platform.java +++ b/arduino-core/src/processing/app/macosx/Platform.java @@ -210,7 +210,7 @@ public class Platform extends processing.app.Platform { } @Override - public String resolveDeviceAttachedTo(String serial, Map packages, String devicesListOutput) { + public Map resolveDeviceAttachedTo(String serial, Map packages, String devicesListOutput) { if (devicesListOutput == null) { return super.resolveDeviceAttachedTo(serial, packages, devicesListOutput); } diff --git a/arduino-core/src/processing/app/windows/Platform.java b/arduino-core/src/processing/app/windows/Platform.java index a35f7c195..e7274bfb0 100644 --- a/arduino-core/src/processing/app/windows/Platform.java +++ b/arduino-core/src/processing/app/windows/Platform.java @@ -317,7 +317,7 @@ public class Platform extends processing.app.Platform { } @Override - public String resolveDeviceAttachedTo(String serial, Map packages, String devicesListOutput) { + public Map resolveDeviceAttachedTo(String serial, Map packages, String devicesListOutput) { if (devicesListOutput == null) { return super.resolveDeviceAttachedTo(serial, packages, devicesListOutput); } diff --git a/hardware/arduino/avr/boards.txt b/hardware/arduino/avr/boards.txt index 07381e405..60b177d1f 100644 --- a/hardware/arduino/avr/boards.txt +++ b/hardware/arduino/avr/boards.txt @@ -11,6 +11,13 @@ yun.vid.0=0x2341 yun.pid.0=0x0041 yun.vid.1=0x2341 yun.pid.1=0x8041 +yun.vid.2=0x2A03 +yun.pid.2=0x0041 +yun.vid.3=0x2A03 +yun.pid.3=0x8041 + +yun.vid.0x2A03.warning=Uncertified + yun.upload.tool=avrdude yun.upload.protocol=avr109 yun.upload.maximum_size=28672 @@ -46,6 +53,10 @@ uno.vid.0=0x2341 uno.pid.0=0x0043 uno.vid.1=0x2341 uno.pid.1=0x0001 +uno.vid.2=0x2A03 +uno.pid.2=0x0043 + +uno.vid.0x2A03.warning=Uncertified uno.upload.tool=avrdude uno.upload.protocol=arduino @@ -166,6 +177,12 @@ mega.vid.0=0x2341 mega.pid.0=0x0010 mega.vid.1=0x2341 mega.pid.1=0x0042 +mega.vid.2=0x2A03 +mega.pid.2=0x0010 +mega.vid.3=0x2A03 +mega.pid.3=0x0042 + +mega.vid.0x2A03.warning=Uncertified mega.upload.tool=avrdude mega.upload.maximum_data_size=8192 @@ -219,6 +236,12 @@ megaADK.vid.0=0x2341 megaADK.pid.0=0x003f megaADK.vid.1=0x2341 megaADK.pid.1=0x0044 +megaADK.vid.2=0x2A03 +megaADK.pid.2=0x003f +megaADK.vid.3=0x2A03 +megaADK.pid.3=0x0044 + +megaADK.vid.0x2A03.warning=Uncertified megaADK.upload.tool=avrdude megaADK.upload.protocol=wiring @@ -247,6 +270,13 @@ leonardo.vid.0=0x2341 leonardo.pid.0=0x0036 leonardo.vid.1=0x2341 leonardo.pid.1=0x8036 +leonardo.vid.2=0x2A03 +leonardo.pid.2=0x0036 +leonardo.vid.3=0x2A03 +leonardo.pid.3=0x8036 + +leonardo.vid.0x2A03.warning=Uncertified + leonardo.upload.tool=avrdude leonardo.upload.protocol=avr109 leonardo.upload.maximum_size=28672 @@ -277,6 +307,17 @@ leonardo.build.extra_flags={build.usb_flags} ############################################################## micro.name=Arduino Micro +micro.vid.0=0x2341 +micro.pid.0=0x0037 +micro.vid.1=0x2341 +micro.pid.1=0x8037 +micro.vid.2=0x2A03 +micro.pid.2=0x0037 +micro.vid.3=0x2A03 +micro.pid.3=0x8037 + +micro.vid.0x2A03.warning=Uncertified + micro.upload.tool=avrdude micro.upload.protocol=avr109 micro.upload.maximum_size=28672 @@ -308,9 +349,16 @@ micro.build.extra_flags={build.usb_flags} esplora.name=Arduino Esplora esplora.vid.0=0x2341 -esplora.pid.0=0x003c +esplora.pid.0=0x003C esplora.vid.1=0x2341 -esplora.pid.1=0x803c +esplora.pid.1=0x803C +esplora.vid.2=0x2A03 +esplora.pid.2=0x003C +esplora.vid.3=0x2A03 +esplora.pid.3=0x803C + +esplora.vid.0x2A03.warning=Uncertified + esplora.upload.tool=avrdude esplora.upload.protocol=avr109 esplora.upload.maximum_size=28672 @@ -477,6 +525,10 @@ bt.menu.cpu.atmega168.build.mcu=atmega168 ############################################################## LilyPadUSB.name=LilyPad Arduino USB +LilyPadUSB.vid.0=0x1B4F +LilyPadUSB.pid.0=0x9207 +LilyPadUSB.vid.1=0x1B4F +LilyPadUSB.pid.1=0x9208 LilyPadUSB.upload.tool=avrdude LilyPadUSB.upload.protocol=avr109 @@ -678,6 +730,17 @@ atmegang.menu.cpu.atmega8.build.mcu=atmega8 ############################################################## robotControl.name=Arduino Robot Control +robotControl.vid.0=0x2341 +robotControl.pid.0=0x0038 +robotControl.vid.1=0x2341 +robotControl.pid.1=0x8038 +robotControl.vid.2=0x2A03 +robotControl.pid.2=0x0038 +robotControl.vid.3=0x2A03 +robotControl.pid.3=0x8038 + +robotControl.vid.0x2A03.warning=Uncertified + robotControl.upload.tool=avrdude robotControl.upload.protocol=avr109 robotControl.upload.maximum_size=28672 @@ -708,6 +771,17 @@ robotControl.build.extra_flags={build.usb_flags} ############################################################## robotMotor.name=Arduino Robot Motor +robotMotor.vid.0=0x2341 +robotMotor.pid.0=0x0039 +robotMotor.vid.1=0x2341 +robotMotor.pid.1=0x8039 +robotMotor.vid.2=0x2A03 +robotMotor.pid.2=0x0039 +robotMotor.vid.3=0x2A03 +robotMotor.pid.3=0x8039 + +robotMotor.vid.0x2A03.warning=Uncertified + robotMotor.upload.tool=avrdude robotMotor.upload.protocol=avr109 robotMotor.upload.maximum_size=28672 diff --git a/hardware/arduino/avr/platform.txt b/hardware/arduino/avr/platform.txt index 797e7e3bf..2854d3918 100644 --- a/hardware/arduino/avr/platform.txt +++ b/hardware/arduino/avr/platform.txt @@ -98,5 +98,5 @@ tools.avrdude.bootloader.pattern="{cmd.path}" "-C{config.path}" {bootloader.verb # USB Default Flags # Default blank usb manufacturer will be filled it at compile time # - from numeric vendor ID, set to Unknown otherwise -build.usb_manufacturer= +build.usb_manufacturer="Unknown" build.usb_flags=-DUSB_VID={build.vid} -DUSB_PID={build.pid} '-DUSB_MANUFACTURER={build.usb_manufacturer}' '-DUSB_PRODUCT={build.usb_product}' diff --git a/hardware/arduino/sam/boards.txt b/hardware/arduino/sam/boards.txt index f1e394baa..119d0ba63 100644 --- a/hardware/arduino/sam/boards.txt +++ b/hardware/arduino/sam/boards.txt @@ -2,6 +2,9 @@ arduino_due_x_dbg.name=Arduino Due (Programming Port) arduino_due_x_dbg.vid.0=0x2341 arduino_due_x_dbg.pid.0=0x003d +arduino_due_x_dbg.vid.1=0x2A03 +arduino_due_x_dbg.pid.1=0x003d +arduino_due_x_dbg.vid.0x2A03.warning=Uncertified arduino_due_x_dbg.upload.tool=bossac arduino_due_x_dbg.upload.protocol=sam-ba arduino_due_x_dbg.upload.maximum_size=524288 @@ -23,6 +26,9 @@ arduino_due_x_dbg.build.pid=0x003e arduino_due_x.name=Arduino Due (Native USB Port) arduino_due_x.vid.0=0x2341 arduino_due_x.pid.0=0x003e +arduino_due_x.vid.1=0x2A03 +arduino_due_x.pid.1=0x003e +arduino_due_x.vid.0x2A03.warning=Uncertified arduino_due_x.upload.tool=bossac arduino_due_x.upload.protocol=sam-ba arduino_due_x.upload.maximum_size=524288