@@ -238,6 +238,8 @@ static bool dusb_convert_varname_to_utf8(dusb_command_t *command) {
238
238
if (command -> varname [0 ] < 'A' || command -> varname [0 ] > 'Z' + 1 ) {
239
239
return false;
240
240
}
241
+ case CALC_VAR_TYPE_APP_VAR :
242
+ case CALC_VAR_TYPE_CERTIFICATE :
241
243
case CALC_VAR_TYPE_OPERATING_SYSTEM :
242
244
memcpy (tiascii , command -> varname , command -> varname_length );
243
245
tiascii [command -> varname_length ] = '\0' ;
@@ -403,6 +405,7 @@ static dusb_state_t dusb_detect(dusb_context_t *context) {
403
405
case CALC_VAR_TYPE_OPERATING_SYSTEM :
404
406
return DUSB_SOS_PING_STATE ;
405
407
case CALC_VAR_TYPE_FLASH_APP :
408
+ case CALC_VAR_TYPE_CERTIFICATE :
406
409
context -> flag = DUSB_VAR_FILE_VAR_FLAG_ARCHIVED ;
407
410
return DUSB_SEND_PING_STATE ;
408
411
default :
@@ -1129,7 +1132,7 @@ int usb_dusb_device(usb_event_t *event) {
1129
1132
* buffer ++ = context -> length >> 8 & 0xFF ;
1130
1133
* buffer ++ = context -> length >> 0 & 0xFF ;
1131
1134
* 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 ;
1133
1136
* buffer ++ = attribute_count >> 8 & 0xFF ;
1134
1137
* buffer ++ = attribute_count >> 0 & 0xFF ;
1135
1138
@@ -1138,7 +1141,7 @@ int usb_dusb_device(usb_event_t *event) {
1138
1141
* buffer ++ = DUSB_ATTR_VAR_TYPE_SIZE >> 8 & 0xFF ;
1139
1142
* buffer ++ = DUSB_ATTR_VAR_TYPE_SIZE >> 0 & 0xFF ;
1140
1143
* 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 ;
1142
1145
* buffer ++ = 0 ;
1143
1146
* buffer ++ = command -> vartype ;
1144
1147
@@ -1148,7 +1151,7 @@ int usb_dusb_device(usb_event_t *event) {
1148
1151
* buffer ++ = DUSB_ATTR_ARCHIVED_SIZE >> 0 & 0xFF ;
1149
1152
* buffer ++ = (command -> flag ? command -> flag : context -> flag >> 7 ) & 1 ;
1150
1153
1151
- if (command -> vartype != CALC_VAR_TYPE_FLASH_APP ) {
1154
+ if (command -> vartype != CALC_VAR_TYPE_FLASH_APP && command -> vartype != CALC_VAR_TYPE_CERTIFICATE ) {
1152
1155
* buffer ++ = DUSB_ATTR_VAR_VERSION >> 8 & 0xFF ;
1153
1156
* buffer ++ = DUSB_ATTR_VAR_VERSION >> 0 & 0xFF ;
1154
1157
* buffer ++ = DUSB_ATTR_VAR_VERSION_SIZE >> 8 & 0xFF ;
0 commit comments