revert additional assertion check which breaks used of hw_alias macro outside of functions (#635)
* revert additional assertion check which breaks used of hw_alias macros outside of functions
This commit is contained in:
		@ -81,11 +81,13 @@ typedef ioptr const const_ioptr;
 | 
			
		||||
#define _REG_(x)
 | 
			
		||||
 | 
			
		||||
// Helper method used by hw_alias macros to optionally check input validity
 | 
			
		||||
static __force_inline uint32_t hw_alias_check_addr(volatile void *addr) {
 | 
			
		||||
    uint32_t rc = (uintptr_t)addr;
 | 
			
		||||
    invalid_params_if(ADDRESS_ALIAS, rc < 0x40000000); // catch likely non HW pointer types
 | 
			
		||||
    return rc;
 | 
			
		||||
}
 | 
			
		||||
#define hw_alias_check_addr(addr) ((uintptr_t)(addr))
 | 
			
		||||
// can't use the following impl as it breaks existing static declarations using hw_alias, so would be a backwards incompatibility
 | 
			
		||||
//static __force_inline uint32_t hw_alias_check_addr(volatile void *addr) {
 | 
			
		||||
//    uint32_t rc = (uintptr_t)addr;
 | 
			
		||||
//    invalid_params_if(ADDRESS_ALIAS, rc < 0x40000000); // catch likely non HW pointer types
 | 
			
		||||
//    return rc;
 | 
			
		||||
//}
 | 
			
		||||
 | 
			
		||||
// Helper method used by xip_alias macros to optionally check input validity
 | 
			
		||||
static __force_inline uint32_t xip_alias_check_addr(const void *addr) {
 | 
			
		||||
 | 
			
		||||
@ -244,7 +244,7 @@ extern void __attribute__((noreturn)) __printflike(1, 0) PICO_PANIC_FUNCTION(__u
 | 
			
		||||
// Use a forwarding method here as it is a little simpler than renaming the symbol as it is used from assembler
 | 
			
		||||
void __attribute__((naked, noreturn)) __printflike(1, 0) panic(__unused const char *fmt, ...) {
 | 
			
		||||
    // if you get an undefined reference here, you didn't define your PICO_PANIC_FUNCTION!
 | 
			
		||||
    asm (
 | 
			
		||||
    __asm (
 | 
			
		||||
            "push {lr}\n"
 | 
			
		||||
#if !PICO_PANIC_FUNCTION_EMPTY
 | 
			
		||||
            "bl " __XSTRING(PICO_PANIC_FUNCTION) "\n"
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user