Added error codes to most StillImageHost demo commands.
[pub/USBasp.git] / Demos / Host / LowLevel / StillImageHost / StillImageHost.c
index f10de4c..dfc7cb7 100644 (file)
@@ -216,28 +216,28 @@ void StillImage_Task(void)
                        uint8_t* DeviceInfoPos = DeviceInfo;\r
                        \r
                        /* Skip over the data before the unicode device information strings */\r
-                       DeviceInfoPos += 8;                                      // Skip to VendorExtensionDesc String\r
-                       DeviceInfoPos += ((*DeviceInfoPos << 1) + 1);            // Skip over VendorExtensionDesc String\r
-                       DeviceInfoPos += 2;                                      // Skip over FunctionalMode\r
-                       DeviceInfoPos += (4 + (*(uint32_t*)DeviceInfoPos << 1)); // Skip over OperationCode Array\r
-                       DeviceInfoPos += (4 + (*(uint32_t*)DeviceInfoPos << 1)); // Skip over EventCode Array\r
-                       DeviceInfoPos += (4 + (*(uint32_t*)DeviceInfoPos << 1)); // Skip over DevicePropCode Array\r
-                       DeviceInfoPos += (4 + (*(uint32_t*)DeviceInfoPos << 1)); // Skip over ObjectFormatCode Array\r
-                       DeviceInfoPos += (4 + (*(uint32_t*)DeviceInfoPos << 1)); // Skip over ObjectFormatCode Array\r
+                       DeviceInfoPos +=  8;                                          // Skip to VendorExtensionDesc String\r
+                       DeviceInfoPos += (1 + UNICODE_STRING_LENGTH(*DeviceInfoPos)); // Skip over VendorExtensionDesc String\r
+                       DeviceInfoPos +=  2;                                          // Skip over FunctionalMode\r
+                       DeviceInfoPos += (4 + (*(uint32_t*)DeviceInfoPos << 1));      // Skip over OperationCode Array\r
+                       DeviceInfoPos += (4 + (*(uint32_t*)DeviceInfoPos << 1));      // Skip over EventCode Array\r
+                       DeviceInfoPos += (4 + (*(uint32_t*)DeviceInfoPos << 1));      // Skip over DevicePropCode Array\r
+                       DeviceInfoPos += (4 + (*(uint32_t*)DeviceInfoPos << 1));      // Skip over ObjectFormatCode Array\r
+                       DeviceInfoPos += (4 + (*(uint32_t*)DeviceInfoPos << 1));      // Skip over ObjectFormatCode Array\r
                        \r
                        /* Extract and convert the Manufacturer Unicode string to ASCII and print it through the USART */\r
                        char Manufacturer[*DeviceInfoPos];\r
                        UnicodeToASCII(DeviceInfoPos, Manufacturer);\r
                        printf_P(PSTR("   Manufacturer: %s\r\n"), Manufacturer);\r
 \r
-                       DeviceInfoPos += ((*DeviceInfoPos << 1) + 1);            // Skip over Manufacturer String\r
+                       DeviceInfoPos += 1 + UNICODE_STRING_LENGTH(*DeviceInfoPos);   // Skip over Manufacturer String\r
 \r
                        /* Extract and convert the Model Unicode string to ASCII and print it through the USART */\r
                        char Model[*DeviceInfoPos];\r
                        UnicodeToASCII(DeviceInfoPos, Model);\r
                        printf_P(PSTR("   Model: %s\r\n"), Model);\r
 \r
-                       DeviceInfoPos += ((*DeviceInfoPos << 1) + 1);            // Skip over Model String\r
+                       DeviceInfoPos += 1 + UNICODE_STRING_LENGTH(*DeviceInfoPos);   // Skip over Model String\r
 \r
                        /* Extract and convert the Device Version Unicode string to ASCII and print it through the USART */\r
                        char DeviceVersion[*DeviceInfoPos];\r