Skip to content

Commit

Permalink
Rework on issue 6166
Browse files Browse the repository at this point in the history
  • Loading branch information
pjzander-signify committed Apr 21, 2021
1 parent de63682 commit fca3657
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/app/util/af-types.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,27 +97,27 @@ typedef void (*EmberAfGenericClusterFunction)(void);
*/
typedef struct
{
#if (BIGENDIAN_CPU)
#if defined(BIGENDIAN_CPU) && (BIGENDIAN_CPU != 0)
// Big endian
#if (UINTPTR_MAX == UINT32_MAX)
uint32_t align : 16;
uint16_t value;
#elif (UINTPTR_MAX == UINT64_MAX)
uint64_t align : 48;
#endif
#endif

/**
* Actual value.
*/
uint16_t value;

#if (!BIGENDIAN_CPU)
#endif
#else
// Little endian
#if (UINTPTR_MAX == UINT32_MAX)
uint16_t value;
uint32_t align : 16;
#elif (UINTPTR_MAX == UINT64_MAX)
uint16_t value;
uint64_t align : 48;
#endif
#endif
} EmberAfAlignValue;

#endif // defined(BIGENDIAN_CPU) && (BIGENDIAN_CPU != 0)
} EmberAfAlignValue16;

/**
* @brief Type for default values.
Expand All @@ -137,7 +137,7 @@ typedef union
/**
* Actual default value if the attribute size is 2 bytes or less.
*/
EmberAfAlignValue defaultValue;
EmberAfAlignValue16 defaultValue;
} EmberAfDefaultAttributeValue;

/**
Expand Down Expand Up @@ -176,7 +176,7 @@ typedef union
/**
* Default value of the attribute.
*/
EmberAfAlignValue defaultValue;
EmberAfAlignValue16 defaultValue;
/**
* Points to the min max attribute value structure, if min/max is
* supported for this attribute.
Expand Down

0 comments on commit fca3657

Please sign in to comment.