mirror of
https://github.com/hathach/tinyusb.git
synced 2025-10-14 01:58:41 +08:00
Fix address translation functions
Signed-off-by: HiFiPhile <admin@hifiphile.com>
This commit is contained in:
@@ -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
|
||||
|
@@ -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
|
||||
//--------------------------------------------------------------------+
|
||||
|
Reference in New Issue
Block a user