Skip to content

Commit a736ed6

Browse files
committed
Sure.
1 parent f590362 commit a736ed6

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

core/usb/dusb.c

+6-3
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,8 @@ static bool dusb_convert_varname_to_utf8(dusb_command_t *command) {
238238
if (command->varname[0] < 'A' || command->varname[0] > 'Z' + 1) {
239239
return false;
240240
}
241+
case CALC_VAR_TYPE_APP_VAR:
242+
case CALC_VAR_TYPE_CERTIFICATE:
241243
case CALC_VAR_TYPE_OPERATING_SYSTEM:
242244
memcpy(tiascii, command->varname, command->varname_length);
243245
tiascii[command->varname_length] = '\0';
@@ -403,6 +405,7 @@ static dusb_state_t dusb_detect(dusb_context_t *context) {
403405
case CALC_VAR_TYPE_OPERATING_SYSTEM:
404406
return DUSB_SOS_PING_STATE;
405407
case CALC_VAR_TYPE_FLASH_APP:
408+
case CALC_VAR_TYPE_CERTIFICATE:
406409
context->flag = DUSB_VAR_FILE_VAR_FLAG_ARCHIVED;
407410
return DUSB_SEND_PING_STATE;
408411
default:
@@ -1129,7 +1132,7 @@ int usb_dusb_device(usb_event_t *event) {
11291132
*buffer++ = context->length >> 8 & 0xFF;
11301133
*buffer++ = context->length >> 0 & 0xFF;
11311134
*buffer++ = DUSB_VPKT_RTS_SILENT;
1132-
attribute_count = command->vartype == CALC_VAR_TYPE_FLASH_APP ? 2 : 3;
1135+
attribute_count = command->vartype == CALC_VAR_TYPE_FLASH_APP || command->vartype == CALC_VAR_TYPE_CERTIFICATE ? 2 : 3;
11331136
*buffer++ = attribute_count >> 8 & 0xFF;
11341137
*buffer++ = attribute_count >> 0 & 0xFF;
11351138

@@ -1138,7 +1141,7 @@ int usb_dusb_device(usb_event_t *event) {
11381141
*buffer++ = DUSB_ATTR_VAR_TYPE_SIZE >> 8 & 0xFF;
11391142
*buffer++ = DUSB_ATTR_VAR_TYPE_SIZE >> 0 & 0xFF;
11401143
*buffer++ = 0xf0;
1141-
*buffer++ = command->vartype == CALC_VAR_TYPE_FLASH_APP ? 0x0f : 0x07;
1144+
*buffer++ = command->vartype == CALC_VAR_TYPE_FLASH_APP || command->vartype == CALC_VAR_TYPE_CERTIFICATE ? 0x0f : 0x07;
11421145
*buffer++ = 0;
11431146
*buffer++ = command->vartype;
11441147

@@ -1148,7 +1151,7 @@ int usb_dusb_device(usb_event_t *event) {
11481151
*buffer++ = DUSB_ATTR_ARCHIVED_SIZE >> 0 & 0xFF;
11491152
*buffer++ = (command->flag ? command->flag : context->flag >> 7) & 1;
11501153

1151-
if (command->vartype != CALC_VAR_TYPE_FLASH_APP) {
1154+
if (command->vartype != CALC_VAR_TYPE_FLASH_APP && command->vartype != CALC_VAR_TYPE_CERTIFICATE) {
11521155
*buffer++ = DUSB_ATTR_VAR_VERSION >> 8 & 0xFF;
11531156
*buffer++ = DUSB_ATTR_VAR_VERSION >> 0 & 0xFF;
11541157
*buffer++ = DUSB_ATTR_VAR_VERSION_SIZE >> 8 & 0xFF;

0 commit comments

Comments
 (0)