ВходНаше всё Теги codebook 无线电组件 Поиск Опросы Закон Четверг
2 мая
488197
Dingo (14.02.2014 14:41 - 15:46, просмотров: 6210)
Господа и дамы, как объявить структуру в PROGMEM ? (хидер поправил, не то сразу скопировал). А то вродь сделал, а оно ругается, не собирает. Что имя структуры - это её адрес, я помню. Копать глубоко не прошу, может на вскидку ошибку кто укажет... хидер: typedef struct { //USB_Descriptor_Header_t Header; uint8_t Size; uint8_t Type; uint16_t USBSpecification; uint8_t Class; uint8_t SubClass; uint8_t Protocol; uint8_t Endpoint0Size; uint16_t VendorID; uint16_t ProductID; uint16_t ReleaseNumber; uint8_t ManufacturerStrIndex; uint8_t ProductStrIndex; uint8_t SerialNumStrIndex; uint8_t NumberOfConfigurations; } ATTR_PACKED USB_Descriptor_Device_t ; Си-файл: const USB_Descriptor_Device_t PROGMEM MyDeviceDescriptor = { //.Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device}, .Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device, .USBSpecification = VERSION_BCD(02.00), .Class = 0x00, .SubClass = 0x00, .Protocol = 0x00, .Endpoint0Size = FIXED_CONTROL_ENDPOINT_SIZE, .VendorID = 0x03EB, .ProductID = 0x2065, .ReleaseNumber = VERSION_BCD(00.01), .ManufacturerStrIndex = 0x01, .ProductStrIndex = 0x02, .SerialNumStrIndex = NO_DESCRIPTOR, .NumberOfConfigurations = 1 } ; Основной файл: // main.h extern USB_Descriptor_Device_t MyDeviceDescriptor; // main.c // skip sendDescriptor( (MyDeviceDescriptor), FIXED_CONTROL_ENDPOINT_SIZE);