mirror of
https://github.com/raphnet/gc_n64_usb-v3
synced 2024-12-21 23:08:53 -05:00
Disable debug
This commit is contained in:
parent
03ebfde089
commit
1dc71a835b
31
usbpad.c
31
usbpad.c
@ -49,6 +49,23 @@
|
|||||||
#define PID_SIMULTANEOUS_MAX 3
|
#define PID_SIMULTANEOUS_MAX 3
|
||||||
#define PID_BLOCK_LOAD_REPORT 2
|
#define PID_BLOCK_LOAD_REPORT 2
|
||||||
|
|
||||||
|
#undef DEBUG
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
static void hexdump(const unsigned char *ptr, int len)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i=0; i<len; i++) {
|
||||||
|
printf_P(PSTR("%02x "), ptr[i]);
|
||||||
|
}
|
||||||
|
printf_P(PSTR("\n"));
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
#define printf_P(...)
|
||||||
|
#define hexdump(...)
|
||||||
|
#endif
|
||||||
|
|
||||||
static void buildIdleReport(unsigned char dstbuf[USBPAD_REPORT_SIZE]);
|
static void buildIdleReport(unsigned char dstbuf[USBPAD_REPORT_SIZE]);
|
||||||
|
|
||||||
void usbpad_init(struct usbpad *pad)
|
void usbpad_init(struct usbpad *pad)
|
||||||
@ -380,16 +397,19 @@ uint8_t usbpad_hid_set_report(struct usbpad *pad, const struct usb_request *rq,
|
|||||||
case REPORT_SET_EFFECT:
|
case REPORT_SET_EFFECT:
|
||||||
pad->_FFB_effect_index = data[1];
|
pad->_FFB_effect_index = data[1];
|
||||||
printf_P(PSTR("set effect %d\r\n"), data[1]);
|
printf_P(PSTR("set effect %d\r\n"), data[1]);
|
||||||
|
hexdump(data, len);
|
||||||
break;
|
break;
|
||||||
case REPORT_SET_PERIODIC:
|
case REPORT_SET_PERIODIC:
|
||||||
pad->periodic_magnitude = data[2];
|
pad->periodic_magnitude = data[2];
|
||||||
printf_P(PSTR("periodic mag: %d"), data[2]);
|
printf_P(PSTR("periodic mag: %d\r\n"), data[2]);
|
||||||
|
hexdump(data, len);
|
||||||
break;
|
break;
|
||||||
case REPORT_SET_CONSTANT_FORCE:
|
case REPORT_SET_CONSTANT_FORCE:
|
||||||
if (data[1] == 1) {
|
if (data[1] == 1) {
|
||||||
pad->constant_force = data[2];
|
pad->constant_force = data[2];
|
||||||
printf_P(PSTR("Constant force %d\r\n"), data[2]);
|
printf_P(PSTR("Constant force %d\r\n"), data[2]);
|
||||||
}
|
}
|
||||||
|
hexdump(data, len);
|
||||||
break;
|
break;
|
||||||
case REPORT_EFFECT_OPERATION:
|
case REPORT_EFFECT_OPERATION:
|
||||||
if (len != 4)
|
if (len != 4)
|
||||||
@ -413,19 +433,22 @@ uint8_t usbpad_hid_set_report(struct usbpad *pad, const struct usb_request *rq,
|
|||||||
switch (data[2]) // effect operation
|
switch (data[2]) // effect operation
|
||||||
{
|
{
|
||||||
case EFFECT_OP_START:
|
case EFFECT_OP_START:
|
||||||
printf_P(PSTR("Start\r\n"));
|
printf_P(PSTR("Start (lp=%d)\r\n"), pad->_loop_count);
|
||||||
pad->vibration_on = 1;
|
pad->vibration_on = 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EFFECT_OP_START_SOLO:
|
case EFFECT_OP_START_SOLO:
|
||||||
printf_P(PSTR("Start solo\r\n"));
|
printf_P(PSTR("Start solo (lp=%d)\r\n"), pad->_loop_count);
|
||||||
pad->vibration_on = 1;
|
pad->vibration_on = 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EFFECT_OP_STOP:
|
case EFFECT_OP_STOP:
|
||||||
printf_P(PSTR("Stop\r\n"));
|
printf_P(PSTR("Stop (lp=%d)\r\n"), pad->_loop_count);
|
||||||
pad->vibration_on = 0;
|
pad->vibration_on = 0;
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
printf_P(PSTR("OP?? %02x (lp=%d)\r\n"), data[2], pad->_loop_count);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user