Skip to content

Commit 655b2a6

Browse files
committed
[ext] Update TinyUSB to v0.17
1 parent d625de0 commit 655b2a6

File tree

4 files changed

+30
-2
lines changed

4 files changed

+30
-2
lines changed

ext/hathach/tinyusb

Submodule tinyusb updated 120 files

ext/rp/irq.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ irq_set_exclusive_handler(int irqn, void (*handler)(void))
2828
{
2929
(void) irqn;
3030
(void) handler;
31-
// do nothing, irq implemented at modm
31+
// do nothing, irq implemented in modm
3232
}
3333

3434
static inline void
@@ -37,6 +37,15 @@ irq_add_shared_handler(unsigned int irqn, void (*handler)(void), uint8_t order_p
3737
(void) irqn;
3838
(void) handler;
3939
(void) order_priority;
40+
// do nothing, irq implemented in modm
41+
}
42+
43+
static inline void
44+
irq_remove_handler(unsigned int irqn, void (*handler)(void))
45+
{
46+
(void) irqn;
47+
(void) handler;
48+
// do nothing, irq implemented in modm
4049
}
4150

4251
#define PICO_SHARED_IRQ_HANDLER_HIGHEST_ORDER_PRIORITY 0xff

ext/rp/pico.cpp.in

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "pico.h"
22
#include "hardware/resets.h"
3+
#include "hardware/regs/sysinfo.h"
34

45
#include <modm/platform/core/resets.hpp>
56
%% if with_debug
@@ -31,3 +32,9 @@ extern "C" void panic(const char *fmt, ...)
3132
%% endif
3233
modm_assert(0, "pico", "Pico-SDK panic!");
3334
}
35+
36+
extern "C" uint8_t rp2040_chip_version(void)
37+
{
38+
const uint32_t chip_id = *((const uint32_t*)(SYSINFO_BASE + SYSINFO_CHIP_ID_OFFSET));
39+
return (chip_id & SYSINFO_CHIP_ID_REVISION_BITS) >> SYSINFO_CHIP_ID_REVISION_LSB;
40+
}

ext/rp/pico.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,18 @@ typedef unsigned int uint;
3737
void
3838
panic(const char* /*fmt*/, ...);
3939

40+
uint8_t rp2040_chip_version(void);
41+
42+
static inline void
43+
busy_wait_at_least_cycles(uint32_t minimum_cycles)
44+
{
45+
asm volatile(
46+
"1: sub %0, #3\t\n"
47+
"bcs 1b\t\n"
48+
: "+l" (minimum_cycles) : : "cc", "memory"
49+
);
50+
}
51+
4052
#ifdef __cplusplus
4153
}
4254
#endif

0 commit comments

Comments
 (0)