Skip to content

Commit fda1b8f

Browse files
committed
sync with master
updating implementation
1 parent 0de7f3e commit fda1b8f

File tree

5 files changed

+10
-4
lines changed

5 files changed

+10
-4
lines changed

cores/rp2040/RP2040USB.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2020
*/
2121

22+
#ifndef USE_TINYUSB
23+
2224
#include <Arduino.h>
2325
#include "CoreMutex.h"
2426
#include "RP2040USB.h"
@@ -317,3 +319,5 @@ void tud_hid_set_report_cb(uint8_t report_id, hid_report_type_t report_type, uin
317319
(void) bufsize;
318320
}
319321

322+
#endif
323+

cores/rp2040/delay.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@ extern "C"
2929
{
3030

3131
void yield(void) {
32+
#ifdef USE_TINYUSB
3233
TinyUSB_Device_Task();
3334
TinyUSB_Device_FlushCDC();
35+
#endif
3436
}
3537

3638
void delay( unsigned long ms ) {
@@ -43,7 +45,7 @@ void delay( unsigned long ms ) {
4345
// TODO better implementation later
4446
// More detail https://github.com/adafruit/circuitpython/pull/2956
4547
while (ms--) {
46-
yield();
48+
// yield();
4749
sleep_ms(1);
4850
}
4951
}

cores/rp2040/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ extern "C" int main() {
5959

6060
mutex_init(&_pioMutex);
6161
initVariant();
62-
__USBStart();
6362

6463
#ifdef USE_TINYUSB
6564
TinyUSB_Device_Init(0);
6665
#else
66+
__USBStart();
6767
#ifndef DISABLE_USB_SERIAL
6868
// Enable serial port for reset/upload always
6969
Serial.begin();

platform.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compil
110110

111111
## Combine gc-sections, archives, and objects
112112
recipe.hooks.linking.prelink.1.pattern="{runtime.tools.pqt-python3.path}/python3" "{runtime.platform.path}/tools/simplesub.py" --input "{runtime.platform.path}/lib/memmap_default.ld" --out "{build.path}/memmap_default.ld" --sub __FLASH_LENGTH__ {build.flash_length} --sub __EEPROM_START__ {build.eeprom_start} --sub __FS_START__ {build.fs_start} --sub __FS_END__ {build.fs_end}
113-
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" "-L{build.path}" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} "-Wl,--script={build.path}/memmap_default.ld" "-Wl,-Map,{build.path}/{build.project_name}.map" --specs=nosys.specs -Wl,--as-needed -Wl,--start-group {compiler.ldflags} -o "{build.path}/{build.project_name}.elf" {object_files} "{build.path}/{archive_file}" -Wl,--whole-archive "{runtime.platform.path}/lib/libpico.a" -Wl,--no-whole-archive -lm "-I{runtime.platform.path}/pico-sdk/src/rp2040/hardware_regs/include/" "-I{runtime.platform.path}/pico-sdk/src/common/pico_binary_info/include" "{runtime.platform.path}/assembly/{build.boot2}.S" -lc -lstdc++ -Wl,--end-group
113+
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" "-L{build.path}" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} "-Wl,--script={build.path}/memmap_default.ld" "-Wl,-Map,{build.path}/{build.project_name}.map" --specs=nosys.specs -Wl,--as-needed -Wl,--start-group {compiler.ldflags} -o "{build.path}/{build.project_name}.elf" {object_files} "{build.path}/{archive_file}" "{runtime.platform.path}/lib/libpico.a" -lm "-I{runtime.platform.path}/pico-sdk/src/rp2040/hardware_regs/include/" "-I{runtime.platform.path}/pico-sdk/src/common/pico_binary_info/include" "{runtime.platform.path}/assembly/{build.boot2}.S" -lc -lstdc++ -Wl,--end-group
114114

115115
## Create output (UF2 file)
116116
recipe.objcopy.uf2.pattern="{runtime.tools.pqt-elf2uf2.path}/elf2uf2" "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.uf2"

0 commit comments

Comments
 (0)