diff --git a/pico_keys_sdk_import.cmake b/pico_keys_sdk_import.cmake index 0d46b87..d3c98c8 100644 --- a/pico_keys_sdk_import.cmake +++ b/pico_keys_sdk_import.cmake @@ -238,6 +238,7 @@ function(add_impl_library target) string(TOUPPER ${target} TARGET_UPPER) target_compile_definitions(${target} INTERFACE LIB_${TARGET_UPPER}=1) endfunction() + if(${USB_ITF_HID}) set(SOURCES ${SOURCES} ${CMAKE_CURRENT_LIST_DIR}/src/usb/hid/hid.c @@ -246,6 +247,9 @@ if(${USB_ITF_HID}) ${CMAKE_CURRENT_LIST_DIR}/src/usb/hid ) endif() + +add_definitions("-fmacro-prefix-map=${CMAKE_CURRENT_LIST_DIR}/=") + if(ENABLE_EMULATION) if(APPLE) add_definitions("-Wno-deprecated-declarations") diff --git a/src/debug.h b/src/debug.h index b5a2ca0..41f8790 100644 --- a/src/debug.h +++ b/src/debug.h @@ -20,7 +20,7 @@ #if defined(DEBUG_APDU) && DEBUG_APDU == 1 #define DEBUG_PAYLOAD(_p, _s) { \ - printf("Payload %s (%d bytes):\n", #_p, (int) (_s)); \ + printf("Payload %s (%d bytes) [%s:%d]:\n", #_p, (int) (_s), __FILE__, __LINE__); \ for (int _i = 0; _i < _s; _i += 16) { \ printf("%" PRIxPTR "h : ", (uintptr_t) (_i + _p)); \ for (int _j = 0; _j < 16; _j++) { \ @@ -37,7 +37,7 @@ } printf("\n"); \ } #define DEBUG_DATA(_p, _s) { \ - printf("Data %s (%d bytes):\n", #_p, (int) (_s)); \ + printf("Data %s (%d bytes) [%s:%d]:\n", #_p, (int) (_s), __FILE__, __LINE__); \ char *_tmp = (char *) calloc(1, 2 * _s + 1); \ for (int _i = 0; _i < _s; _i++) { \ sprintf(&_tmp[2 * _i], "%02X", (_p)[_i]); \