Skip to content

Commit

Permalink
[window-covering] Fix compilation error on some compilers (#16491)
Browse files Browse the repository at this point in the history
OperationalStatus structure contains enum class bitfields,
which on some compilers (e.g. GCC prior to 9.3) generates
"is too small to hold all values of
‘enum class OperationalState’" warning. It is a default
warning that cannot be suppressed.

Since OperationalStatus it not stored directly in the
attribute table, but it is rather used to exchange decoded
components of the attribute with the application, the
bitfield usage is not really valuable. Switch to normal
structure members for greater portability.
  • Loading branch information
Damian-Nordic authored and pull[bot] committed May 5, 2022
1 parent 22c0b61 commit 2453904
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ enum class OperationalState : uint8_t
};
static_assert(sizeof(OperationalState) == sizeof(uint8_t), "OperationalState Size is not correct");

// Decoded components of the OperationalStatus attribute
struct OperationalStatus
{
OperationalState global : 2; // bit 0-1 M
OperationalState lift : 2; // bit 2-3 LF
OperationalState tilt : 2; // bit 4-5 TL
OperationalState global; // bit 0-1 M
OperationalState lift; // bit 2-3 LF
OperationalState tilt; // bit 4-5 TL
};
static_assert(sizeof(OperationalStatus) == sizeof(uint8_t), "OperationalStatus Size is not correct");

struct SafetyStatus
{
Expand Down

0 comments on commit 2453904

Please sign in to comment.