Merge pull request #1641 from openmv/new_usbdbg_commands

ports/all: Add placeholders for new USBDBG commands.
This commit is contained in:
Ibrahim Abdelkader 2022-05-15 19:11:07 +02:00 committed by GitHub
commit 4455c030c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 39 additions and 1 deletions

View File

@ -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;

View File

@ -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();