I have a struct defined like this:
struct StructLogDataHs {
u8_t NLogDataHsPages;
u8_t NLogDataHsChannels;
u16_t NLogDataHsSamples;
u32_t tLogDataHsTimeOffset0;
u32_t tLogDataHsTimeOffset1;
struct StructLogDataPageHs LogDataPageHs[Hs_Pages];
where the StructLogDataPageHs is defined as
struct StructLogDataPageHs {
u32_t NLogDataHsFilled;
u32_t NLogDataHsExceedingElements;
u32_t NLogDataHsExceedingData[128];
u32_t NLogDataHsPacketSize;
u32_t NLogDataHsPayloadType;
u32_t NLogDataHsAlignBytes;
u32_t NLogDataHsResevedBytes;
u32_t NLogDataHsPageHeader;
u32_t NLogDataHsTimeStamp0;
u32_t NLogDataHsTimeStamp1;
u32_t NLogDataHs[Hs_PageSize];
so it is a struct inside a struct. As you can see the size for the object NLogDataHs is defined as #define Hs_PageSize 10000 The same is done for Hs_Pages with #define Hs_Pages 3 The struct is allocated with
__attribute__ ((section(".logdata_h_slow_mem")))
struct StructLogDataHs LogDataHs;
I would like to have a second struct, with exact the same structure but with different sizes, without defining a new struct object. Is it possible to create the structure object with different sizes using the same struct definition?