Пытаюсь портировать библиотеку LUFA на рельсы ARM (EZR32) и встретил такую запись в файле em_usb.h из родного (от SiLabs) SDK: Код (C++): #define USB_STRING_DESCRIPTOR 3 /**< STRING descriptor value. */ В пользовательском файле есть такие строки (это из примера): Код (C++): /** Manufacturer descriptor string. This is a Unicode string containing the manufacturer's details in human readable * form, and is read out upon request by the host when the appropriate string ID is requested, listed in the Device * Descriptor. */ const USB_Descriptor_String_t PROGMEM ManufacturerString = USB_STRING_DESCRIPTOR(L"Dean Camera"); /** Product descriptor string. This is a Unicode string containing the product's details in human readable form, * and is read out upon request by the host when the appropriate string ID is requested, listed in the Device * Descriptor. */ const USB_Descriptor_String_t PROGMEM ProductString = USB_STRING_DESCRIPTOR(L"LUFA CDC Demo"); Компилятор ругается так на самую верхнюю запись этого поста: Код (Text): Description Resource Path Location Type called object is not a function or function pointer USB_EZR32HG320F64R61_dummy line 128, external location: d:\siliconlabs\simplicitystudio\v4\developer\sdks\gecko_sdk_suite\v2.7\platform\middleware\usb_gecko\inc\em_usb.h C/C++ Problem Что это за запись? Возможно, необходимо ещё какое-то определение или макрос, чтобы компилятор проглотил?
Переопределение макроса - в LUFA Код (C++): #define USB_STRING_DESCRIPTOR(String) { .Header = {.Size = sizeof(USB_Descriptor_Header_t) + (sizeof(String) - 2), .Type = DTYPE_String}, .UnicodeString = String } в SiLabs em_usb.h Код (C++): #define USB_STRING_DESCRIPTOR 3
Так а как же заставить использовать переопределение LUFA? Или у меня почему-то не аттачиться файл StdDescriptors.h?
В предупрежденияx компилятора есть что-то подобное - warning : Redefinition of macro USB_STRING_DESCRIPTOR. ?