diff options
| author | HiFiPhile <[email protected]> | 2025-09-17 23:48:58 +0200 |
|---|---|---|
| committer | HiFiPhile <[email protected]> | 2025-09-17 23:48:58 +0200 |
| commit | ce41292f1b49fe39d54a9d4c2951fec56b8c13f5 (patch) | |
| tree | 8cb2722b9f562cd68400d3551d2a8a60750a9596 /src | |
| parent | 47bb79abe2e89f4bd7c7afa556cabc9e50fbbc3e (diff) | |
Fix address translation functions
Signed-off-by: HiFiPhile <[email protected]>
Diffstat (limited to 'src')
| -rw-r--r-- | src/portable/ohci/ohci.c | 6 | ||||
| -rw-r--r-- | src/tusb.c | 8 |
2 files changed, 10 insertions, 4 deletions
diff --git a/src/portable/ohci/ohci.c b/src/portable/ohci/ohci.c index f517e044e..f1689b5b4 100644 --- a/src/portable/ohci/ohci.c +++ b/src/portable/ohci/ohci.c @@ -168,14 +168,12 @@ static gtd_extra_data_t *gtd_get_extra_data(ohci_gtd_t const * const gtd); // tusb_app_virt_to_phys and tusb_app_virt_to_phys in your application. TU_ATTR_ALWAYS_INLINE static inline void *_phys_addr(void *virtual_address) { - if (tusb_app_virt_to_phys) return tusb_app_virt_to_phys(virtual_address); - return virtual_address; + return tusb_app_virt_to_phys(virtual_address); } TU_ATTR_ALWAYS_INLINE static inline void *_virt_addr(void *physical_address) { - if (tusb_app_phys_to_virt) return tusb_app_phys_to_virt(physical_address); - return physical_address; + return tusb_app_phys_to_virt(physical_address); } // Initialization according to 5.1.1.4 diff --git a/src/tusb.c b/src/tusb.c index 5a3ea356b..083e6d861 100644 --- a/src/tusb.c +++ b/src/tusb.c @@ -55,6 +55,14 @@ TU_ATTR_WEAK void tusb_time_delay_ms_api(uint32_t ms) { #endif } +TU_ATTR_WEAK void* tusb_app_virt_to_phys(void *virt_addr) { + return virt_addr; +} + +TU_ATTR_WEAK void* tusb_app_phys_to_virt(void *phys_addr) { + return phys_addr; +} + //--------------------------------------------------------------------+ // Public API //--------------------------------------------------------------------+ |
