mirror of
https://github.com/polhenarejos/pico-keys-sdk
synced 2026-05-28 17:11:23 +02:00
Compilation fixes in debug mode
This commit is contained in:
@@ -107,6 +107,10 @@
|
|||||||
#define CFG_TUD_VENDOR_RX_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 64)
|
#define CFG_TUD_VENDOR_RX_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 64)
|
||||||
#define CFG_TUD_VENDOR_TX_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 64)
|
#define CFG_TUD_VENDOR_TX_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 64)
|
||||||
|
|
||||||
|
#include "pico/types.h"
|
||||||
|
static inline uint16_t tu_u32_high16(uint32_t ui32) { return (uint16_t) (ui32 >> 16); }
|
||||||
|
static inline uint16_t tu_u32_low16 (uint32_t ui32) { return (uint16_t) (ui32 & 0x0000ffffu); }
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -48,27 +48,9 @@ uint32_t usb_write_offset(uint16_t len, uint16_t offset) {
|
|||||||
return MIN(w_len, pkt_max);
|
return MIN(w_len, pkt_max);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define DEBUG_PAYLOAD(p,s) { \
|
|
||||||
printf("Payload %s (%d bytes):\r\n", #p,s);\
|
|
||||||
for (int i = 0; i < s; i += 16) {\
|
|
||||||
printf("%07Xh : ",(unsigned int)(i+p));\
|
|
||||||
for (int j = 0; j < 16; j++) {\
|
|
||||||
if (j < s-i) printf("%02X ",(p)[i+j]);\
|
|
||||||
else printf(" ");\
|
|
||||||
if (j == 7) printf(" ");\
|
|
||||||
} printf(": "); \
|
|
||||||
for (int j = 0; j < MIN(16,s-i); j++) {\
|
|
||||||
printf("%c",(p)[i+j] == 0x0a || (p)[i+j] == 0x0d ? '\\' : (p)[i+j]);\
|
|
||||||
if (j == 7) printf(" ");\
|
|
||||||
}\
|
|
||||||
printf("\r\n");\
|
|
||||||
} printf("\r\n"); \
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
uint32_t usb_write_flush() {
|
uint32_t usb_write_flush() {
|
||||||
if (w_len > 0 && tud_vendor_write_available() > 0) {
|
if (w_len > 0 && tud_vendor_write_available() > 0) {
|
||||||
printf("w_len %d %d %ld\r\n",w_len,tx_r_offset,tud_vendor_write_available());
|
//printf("w_len %d %d %ld\r\n",w_len,tx_r_offset,tud_vendor_write_available());
|
||||||
tud_vendor_write(tx_buffer+tx_r_offset, MIN(w_len, 64));
|
tud_vendor_write(tx_buffer+tx_r_offset, MIN(w_len, 64));
|
||||||
tx_r_offset += MIN(w_len, 64);
|
tx_r_offset += MIN(w_len, 64);
|
||||||
w_len -= MIN(w_len, 64);
|
w_len -= MIN(w_len, 64);
|
||||||
|
|||||||
Reference in New Issue
Block a user