Skip to content

Commit

Permalink
[ext] Update TinyUSB to v0.16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
salkinium committed Dec 23, 2023
1 parent 074fe2f commit bc6cd8e
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 11 deletions.
2 changes: 1 addition & 1 deletion ext/hathach/module.lb
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def build(env):
# PMA buffer size: 512B or 1024B
env.copy("tinyusb/src/portable/st/stm32_fsdev/", "portable/st/stm32_fsdev/")
else:
env.copy("tinyusb/src/portable/st/synopsys", "portable/st/synopsys/")
env.copy("tinyusb/src/portable/synopsys/dwc2/", "portable/synopsys/dwc2/")

elif target.platform == "sam":
if target.family == "g5x":
Expand Down
2 changes: 1 addition & 1 deletion ext/hathach/tinyusb
Submodule tinyusb updated 123 files
11 changes: 7 additions & 4 deletions ext/hathach/tusb_config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,14 @@

// Redirect TinyUSB asserts to use modm_assert
#define MODM_ASSERT_1ARGS(_cond) \
TU_VERIFY_DEFINE(_cond, modm_assert(0, "tu", \
__FILE__ ":" MODM_STRINGIFY(__LINE__) " -> \"" #_cond "\""), false)
do { \
return modm_assert(_cond, "tu", __FILE__ ":" MODM_STRINGIFY(__LINE__) " -> \"" #_cond "\""); \
} while(0)

#define MODM_ASSERT_2ARGS(_cond, _ret) \
TU_VERIFY_DEFINE(_cond, modm_assert_continue_fail(0, "tu", \
__FILE__ ":" MODM_STRINGIFY(__LINE__) " -> \"" #_cond "\""), _ret)
do { \
modm_assert(_cond, "tu", __FILE__ ":" MODM_STRINGIFY(__LINE__) " -> \"" #_cond "\""); \
return _ret; \
} while(0)

#define TU_ASSERT(...) _GET_3RD_ARG(__VA_ARGS__, MODM_ASSERT_2ARGS, MODM_ASSERT_1ARGS,UNUSED)(__VA_ARGS__)
10 changes: 5 additions & 5 deletions ext/rp/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@ irq_set_enabled(int irqn, bool enable)
}

static inline void
irq_set_exclusive_handler(int irqn, void (*handler)())
irq_set_exclusive_handler(int irqn, void (*handler)(void))
{
(void) irqn;
(void) handler;
// do nothing, irq implemented at modm
}

static inline void
irq_add_shared_handler(unsigned int irqn, void (*handler)(), uint8_t order_priority)
irq_add_shared_handler(unsigned int irqn, void (*handler)(void), uint8_t order_priority)
{
(void) irqn;
(void) handler;
(void) order_priority;
(void) irqn;
(void) handler;
(void) order_priority;
}

#define PICO_SHARED_IRQ_HANDLER_HIGHEST_ORDER_PRIORITY 0xff
1 change: 1 addition & 0 deletions ext/rp/module.lb
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def build(env):
env.copy("irq.h", "hardware/irq.h")
env.copy("timer.h", "hardware/timer.h")
env.copy("resets.h", "hardware/resets.h")
env.copy("sync.h", "hardware/sync.h")

env.substitutions = {
"headers": headers,
Expand Down
14 changes: 14 additions & 0 deletions ext/rp/sync.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* Copyright (c) 2023, Niklas Hauser
*
* This file is part of the modm project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
// ----------------------------------------------------------------------------

// Stripped down header "hardware/sync.h" for tinyusb

#define remove_volatile_cast(t, x) ({ __asm volatile ("dmb" ::: "memory"); (t)(x); })

0 comments on commit bc6cd8e

Please sign in to comment.