Skip to content

Commit d64cb94

Browse files
committed
Merge remote-tracking branch 'arduino/master' into iserial2_complete
2 parents a1efb61 + 9a6bb84 commit d64cb94

File tree

13 files changed

+68
-34
lines changed

13 files changed

+68
-34
lines changed

arduino-core/src/cc/arduino/contributions/packages/ContributionsIndexer.java

+9-2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
import cc.arduino.contributions.SignatureVerifier;
3737
import cc.arduino.contributions.filters.BuiltInPredicate;
3838
import cc.arduino.contributions.filters.InstalledPredicate;
39+
40+
import com.fasterxml.jackson.core.JsonProcessingException;
3941
import com.fasterxml.jackson.databind.DeserializationFeature;
4042
import com.fasterxml.jackson.databind.ObjectMapper;
4143
import com.fasterxml.jackson.module.mrbean.MrBeanModule;
@@ -87,8 +89,13 @@ public void parseIndex() throws Exception {
8789
File[] indexFiles = preferencesFolder.listFiles(new TestPackageIndexFilenameFilter(new PackageIndexFilenameFilter(Constants.DEFAULT_INDEX_FILE_NAME)));
8890

8991
for (File indexFile : indexFiles) {
90-
ContributionsIndex contributionsIndex = parseIndex(indexFile);
91-
mergeContributions(contributionsIndex, indexFile);
92+
try {
93+
ContributionsIndex contributionsIndex = parseIndex(indexFile);
94+
mergeContributions(contributionsIndex, indexFile);
95+
} catch (JsonProcessingException e) {
96+
System.err.println(I18n.format(tr("Skipping contributed index file {0}, parsing error occured:"), indexFile));
97+
System.err.println(e);
98+
}
9299
}
93100

94101
List<ContributedPackage> packages = index.getPackages();

arduino-core/src/processing/app/i18n/Resources_en.po

+5
Original file line numberDiff line numberDiff line change
@@ -1885,6 +1885,11 @@ msgstr "Sketchbook location:"
18851885
msgid "Sketchbook path not defined"
18861886
msgstr "Sketchbook path not defined"
18871887

1888+
#: ../../../../../arduino-core/src/cc/arduino/contributions/packages/ContributionsIndexer.java:96
1889+
#, java-format
1890+
msgid "Skipping contributed index file {0}, parsing error occured:"
1891+
msgstr ""
1892+
18881893
#: ../../../../../app/src/processing/app/Preferences.java:185
18891894
msgid "Slovak"
18901895
msgstr "Slovak"

arduino-core/src/processing/app/i18n/Resources_en.properties

+4
Original file line numberDiff line numberDiff line change
@@ -1378,6 +1378,10 @@ Sketchbook\ location\:=Sketchbook location\:
13781378
#: ../../../processing/app/BaseNoGui.java:428
13791379
Sketchbook\ path\ not\ defined=Sketchbook path not defined
13801380

1381+
#: ../../../../../arduino-core/src/cc/arduino/contributions/packages/ContributionsIndexer.java:96
1382+
#, java-format
1383+
!Skipping\ contributed\ index\ file\ {0},\ parsing\ error\ occured\:=
1384+
13811385
#: ../../../../../app/src/processing/app/Preferences.java:185
13821386
Slovak=Slovak
13831387

build/shared/examples/04.Communication/ReadASCIIString/ReadASCIIString.ino

+8-5
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,17 @@
55
It looks for an ASCII string of comma-separated values.
66
It parses them into ints, and uses those to fade an RGB LED.
77
8-
Circuit: Common-anode RGB LED wired like so:
9-
* Red cathode: digital pin 3
10-
* Green cathode: digital pin 5
11-
* blue cathode: digital pin 6
12-
* anode: +5V
8+
Circuit: Common-Cathode RGB LED wired like so:
9+
* Red anode: digital pin 3
10+
* Green anode: digital pin 5
11+
* Blue anode: digital pin 6
12+
* Cathode : GND
1313
1414
created 13 Apr 2012
1515
by Tom Igoe
16+
17+
modified 14 Mar 2016
18+
by Arturo Guadalupi
1619
1720
This example code is in the public domain.
1821
*/

build/shared/revisions.txt

+5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
ARDUINO 1.6.9
22

33
[ide]
4+
* Catch and report errors during parsing contributed index files
5+
46
[core]
7+
* sam: Allow 3rd party boards that depend on SAM core to use their own
8+
USB vid/pid and manufacturer/product strings. Thanks @philmanofsky.
9+
510
[libraries]
611

712
ARDUINO 1.6.8 - 2016.03.09

hardware/arduino/avr/libraries/Wire/src/Wire.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ void TwoWire::end(void)
8080
twi_disable();
8181
}
8282

83-
void TwoWire::setClock(uint32_t frequency)
83+
void TwoWire::setClock(uint32_t clock)
8484
{
85-
TWBR = ((F_CPU / frequency) - 16) / 2;
85+
twi_setFrequency(clock);
8686
}
8787

8888
uint8_t TwoWire::requestFrom(uint8_t address, uint8_t quantity, uint32_t iaddress, uint8_t isize, uint8_t sendStop)

hardware/arduino/avr/libraries/Wire/src/utility/twi.c

+16
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,22 @@ void twi_setAddress(uint8_t address)
118118
TWAR = address << 1;
119119
}
120120

121+
/*
122+
* Function twi_setClock
123+
* Desc sets twi bit rate
124+
* Input Clock Frequency
125+
* Output none
126+
*/
127+
void twi_setFrequency(uint32_t frequency)
128+
{
129+
TWBR = ((F_CPU / frequency) - 16) / 2;
130+
131+
/* twi bit rate formula from atmega128 manual pg 204
132+
SCL Frequency = CPU Clock Frequency / (16 + (2 * TWBR))
133+
note: TWBR should be 10 or higher for master mode
134+
It is 72 for a 16mhz Wiring board with 100kHz TWI */
135+
}
136+
121137
/*
122138
* Function twi_readFrom
123139
* Desc attempts to become twi bus master and read a

hardware/arduino/avr/libraries/Wire/src/utility/twi.h

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
void twi_init(void);
4242
void twi_disable(void);
4343
void twi_setAddress(uint8_t);
44+
void twi_setFrequency(uint32_t);
4445
uint8_t twi_readFrom(uint8_t, uint8_t*, uint8_t, uint8_t);
4546
uint8_t twi_writeTo(uint8_t, uint8_t*, uint8_t, uint8_t, uint8_t);
4647
uint8_t twi_transmit(const uint8_t*, uint8_t);

hardware/arduino/avr/platform.txt

+4-6
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,18 @@ name=Arduino AVR Boards
99
version=1.6.10
1010

1111
# AVR compile variables
12-
# ---------------------
12+
# ---------------------
1313

1414
compiler.warning_flags=-w
1515
compiler.warning_flags.none=-w
1616
compiler.warning_flags.default=
1717
compiler.warning_flags.more=-Wall
1818
compiler.warning_flags.all=-Wall -Wextra
1919

20-
# Default "compiler.path" is correct, change only if you want to overidde the initial value
20+
# Default "compiler.path" is correct, change only if you want to override the initial value
2121
compiler.path={runtime.tools.avr-gcc.path}/bin/
2222
compiler.c.cmd=avr-gcc
2323
compiler.c.flags=-c -g -Os {compiler.warning_flags} -std=gnu11 -ffunction-sections -fdata-sections -MMD
24-
# -w flag added to avoid printing a wrong warning http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59396
25-
# This is fixed in gcc 4.8.3 and will be removed as soon as we update the toolchain
2624
compiler.c.elf.flags={compiler.warning_flags} -Os -Wl,--gc-sections
2725
compiler.c.elf.cmd=avr-gcc
2826
compiler.S.flags=-c -g -x assembler-with-cpp
@@ -37,7 +35,7 @@ compiler.elf2hex.cmd=avr-objcopy
3735
compiler.ldflags=
3836
compiler.size.cmd=avr-size
3937

40-
# This can be overriden in boards.txt
38+
# This can be overridden in boards.txt
4139
build.extra_flags=
4240

4341
# These can be overridden in platform.local.txt
@@ -113,7 +111,7 @@ tools.avrdude.bootloader.pattern="{cmd.path}" "-C{config.path}" {bootloader.verb
113111

114112

115113
# USB Default Flags
116-
# Default blank usb manufacturer will be filled it at compile time
114+
# Default blank usb manufacturer will be filled in at compile time
117115
# - from numeric vendor ID, set to Unknown otherwise
118116
build.usb_manufacturer="Unknown"
119117
build.usb_flags=-DUSB_VID={build.vid} -DUSB_PID={build.pid} '-DUSB_MANUFACTURER={build.usb_manufacturer}' '-DUSB_PRODUCT={build.usb_product}'

hardware/arduino/sam/boards.txt

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ arduino_due_x_dbg.upload.wait_for_upload_port=false
1212
arduino_due_x_dbg.upload.native_usb=false
1313
arduino_due_x_dbg.build.mcu=cortex-m3
1414
arduino_due_x_dbg.build.f_cpu=84000000L
15+
arduino_due_x_dbg.build.usb_manufacturer="Arduino LLC"
1516
arduino_due_x_dbg.build.usb_product="Arduino Due"
1617
arduino_due_x_dbg.build.board=SAM_DUE
1718
arduino_due_x_dbg.build.core=arduino
@@ -35,6 +36,7 @@ arduino_due_x.upload.wait_for_upload_port=true
3536
arduino_due_x.upload.native_usb=true
3637
arduino_due_x.build.mcu=cortex-m3
3738
arduino_due_x.build.f_cpu=84000000L
39+
arduino_due_x.build.usb_manufacturer="Arduino LLC"
3840
arduino_due_x.build.usb_product="Arduino Due"
3941
arduino_due_x.build.board=SAM_DUE
4042
arduino_due_x.build.core=arduino

hardware/arduino/sam/cores/arduino/Arduino.h

+8-4
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,14 @@ extern const PinDescription g_APinDescription[] ;
209209
#include "watchdog.h"
210210

211211
// USB Device
212-
#define USB_VID 0x2341 // arduino LLC vid
213-
#define USB_PID_LEONARDO 0x0034
214-
#define USB_PID_MICRO 0x0035
215-
#define USB_PID_DUE 0x003E
212+
#ifndef USB_VID
213+
#define USB_VID 0x2341 // arduino LLC vid
214+
#endif
215+
216+
#ifndef USB_PID
217+
#define USB_PID 0x003E // arduino Due pid
218+
#endif
219+
216220
#include "USB/USBDesc.h"
217221
#include "USB/USBCore.h"
218222
#include "USB/USBAPI.h"

hardware/arduino/sam/cores/arduino/USB/USBCore.cpp

+3-14
Original file line numberDiff line numberDiff line change
@@ -66,27 +66,16 @@ const uint16_t STRING_LANGUAGE[2] = {
6666
};
6767

6868
#ifndef USB_PRODUCT
69-
// Use a hardcoded product name if none is provided
70-
#if USB_PID == USB_PID_DUE
7169
#define USB_PRODUCT "Arduino Due"
72-
#else
73-
#define USB_PRODUCT "USB IO Board"
74-
#endif
7570
#endif
7671

7772
const uint8_t STRING_PRODUCT[] = USB_PRODUCT;
7873

79-
#if USB_VID == 0x2341
80-
# if defined(USB_MANUFACTURER)
81-
# undef USB_MANUFACTURER
82-
# endif
83-
# define USB_MANUFACTURER "Arduino LLC"
84-
#elif !defined(USB_MANUFACTURER)
85-
// Fall through to unknown if no manufacturer name was provided in a macro
86-
# define USB_MANUFACTURER "Unknown"
74+
#ifndef USB_MANUFACTURER
75+
#define USB_MANUFACTURER "Arduino LLC"
8776
#endif
8877

89-
const uint8_t STRING_MANUFACTURER[12] = USB_MANUFACTURER;
78+
const uint8_t STRING_MANUFACTURER[] = USB_MANUFACTURER;
9079

9180
#ifdef CDC_ENABLED
9281
#define DEVICE_CLASS 0x02

hardware/arduino/sam/platform.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ compiler.ldflags=
3636
compiler.size.cmd=arm-none-eabi-size
3737
compiler.define=-DARDUINO=
3838

39-
# this can be overriden in boards.txt
39+
# This can be overridden in boards.txt
4040
build.extra_flags=
4141

4242
# These can be overridden in platform.local.txt

0 commit comments

Comments
 (0)