move PACKED, add it to led_t too

This commit is contained in:
elpekenin 2025-04-23 15:44:09 +02:00
parent 04ebdf6136
commit fae7c04de0
2 changed files with 5 additions and 3 deletions

View File

@ -36,8 +36,8 @@ typedef union {
bool right_shift : 1;
bool right_alt : 1;
bool right_gui : 1;
} PACKED;
} mod_t;
};
} PACKED mod_t;
_Static_assert(sizeof(mod_t) == sizeof(uint8_t), "Invalid size for 'mod_t'");
extern report_keyboard_t *keyboard_report;

View File

@ -19,6 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <stdint.h>
#include <stdbool.h>
#include "util.h"
/* FIXME: Add doxygen comments here. */
@ -36,7 +37,8 @@ typedef union {
bool kana : 1;
uint8_t reserved : 3;
};
} led_t;
} PACKED led_t;
_Static_assert(sizeof(led_t) == sizeof(uint8_t), "Invalid size for 'led_t'");
void led_set(uint8_t usb_led);