From 42bd64d8b093271297e3e8bc214228dfa0e46abe Mon Sep 17 00:00:00 2001 From: iabdalkader Date: Sun, 15 May 2022 19:06:26 +0200 Subject: [PATCH] ports/all: Add placeholders for new USBDBG commands. * Fixes #1634. * Fixes #1635. --- src/omv/common/usbdbg.c | 36 ++++++++++++++++++++++++++++++++++++ src/omv/common/usbdbg.h | 4 +++- 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/src/omv/common/usbdbg.c b/src/omv/common/usbdbg.c index 681e2c078..cd4a225e7 100644 --- a/src/omv/common/usbdbg.c +++ b/src/omv/common/usbdbg.c @@ -300,6 +300,32 @@ void usbdbg_data_out(void *buffer, int length) break; } + case USBDBG_SET_TIME: { + // TODO implement + #if 0 + uint32_t *timebuf = (uint32_t*)buffer; + timebuf[0]; // Year + timebuf[1]; // Month + timebuf[2]; // Day + timebuf[3]; // Day of the week + timebuf[4]; // Hour + timebuf[5]; // Minute + timebuf[6]; // Second + timebuf[7]; // Milliseconds + #endif + cmd = USBDBG_NONE; + break; + } + + case USBDBG_TX_INPUT: { + // TODO implement + #if 0 + uint32_t key= *((uint32_t*)buffer); + #endif + cmd = USBDBG_NONE; + break; + } + default: /* error */ break; } @@ -409,6 +435,16 @@ void usbdbg_control(void *buffer, uint8_t request, uint32_t length) xfer_length = length; break; + case USBDBG_SET_TIME: + xfer_bytes = 0; + xfer_length =length; + break; + + case USBDBG_TX_INPUT: + xfer_bytes = 0; + xfer_length =length; + break; + default: /* error */ cmd = USBDBG_NONE; break; diff --git a/src/omv/common/usbdbg.h b/src/omv/common/usbdbg.h index 6cfeec6f1..0497c262f 100644 --- a/src/omv/common/usbdbg.h +++ b/src/omv/common/usbdbg.h @@ -46,7 +46,9 @@ enum usbdbg_cmd { USBDBG_FB_ENABLE =0x0D, USBDBG_TX_BUF_LEN =0x8E, USBDBG_TX_BUF =0x8F, - USBDBG_SENSOR_ID =0x90 + USBDBG_SENSOR_ID =0x90, + USBDBG_TX_INPUT =0x11, + USBDBG_SET_TIME =0x12, }; void usbdbg_init();