Skip to content

Commit bcc44cc

Browse files
committed
DM: samd51 USB fix for rebase
1 parent 0c05d94 commit bcc44cc

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

cores/arduino/USB/USBCore.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,11 @@ bool USBDeviceClass::sendDescriptor(USBSetup &setup)
244244
}
245245
else if (setup.wValueL == ISERIAL) {
246246
#ifdef PLUGGABLE_USB_ENABLED
247+
#if defined(__SAMD51__)
248+
char name[ISERIAL_MAX_LEN];
249+
PluggableUSB().getShortName(name);
250+
return sendStringDescriptor((uint8_t*)name, setup.wLength);
251+
#else
247252
// from section 9.3.3 of the datasheet
248253
#define SERIAL_NUMBER_WORD_0 *(volatile uint32_t*)(0x0080A00C)
249254
#define SERIAL_NUMBER_WORD_1 *(volatile uint32_t*)(0x0080A040)
@@ -258,6 +263,7 @@ bool USBDeviceClass::sendDescriptor(USBSetup &setup)
258263

259264
PluggableUSB().getShortName(&name[32]);
260265
return sendStringDescriptor((uint8_t*)name, setup.wLength);
266+
#endif
261267
#endif
262268
}
263269
else {

platform.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} -D
8888
recipe.S.o.pattern="{compiler.path}{compiler.S.cmd}" {compiler.S.flags} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.S.extra_flags} {build.extra_flags} {build.cache_flags} {compiler.arm.cmsis.c.flags} {includes} "{source_file}" -o "{object_file}"
8989

9090
## Create archives
91-
recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{build.path}/{archive_file}" "{object_file}"
91+
recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}"
9292

9393
## Combine gc-sections, archives, and objects
9494
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" "-L{build.path}" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} "-T{build.variant.path}/{build.ldscript}" "-Wl,-Map,{build.path}/{build.project_name}.map" --specs=nano.specs --specs=nosys.specs {compiler.ldflags} -o "{build.path}/{build.project_name}.elf" {object_files} -Wl,--start-group {compiler.arm.cmsis.ldflags} "-L{build.variant.path}" -lm "{build.path}/{archive_file}" -Wl,--end-group

0 commit comments

Comments
 (0)