Skip to content
Snippets Groups Projects
Commit cb44cc64 authored by Joakim Nohlgård's avatar Joakim Nohlgård
Browse files

Merge pull request #3113 from kaspar030/fix_bitfield

sys: bitfield.h: some fixes
parents 4906dbca 3965e889
No related branches found
No related tags found
No related merge requests found
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include <stdint.h> #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
#include <stddef.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
...@@ -38,7 +39,7 @@ extern "C" { ...@@ -38,7 +39,7 @@ extern "C" {
* @note SIZE should be a constant expression. This avoids variable length * @note SIZE should be a constant expression. This avoids variable length
* arrays. * arrays.
*/ */
#define BITFIELD(NAME, SIZE) (uint8_t NAME[((SIZE) + 7) / 8]) #define BITFIELD(NAME, SIZE) uint8_t NAME[((SIZE) + 7) / 8]
/** /**
* @brief Set the bit to 1 * @brief Set the bit to 1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment