X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=tmk_core%2Fcommon%2Freport.h;h=899fc524cbdb2a159ef5e97eb4e5463b9b912885;hb=92b74e2d3612884237ecbdbea18bc5b70d859234;hp=f6c0a315de9307de6c62ac6e2489e3ce2e62e750;hpb=1a02ebcc612e9a9c0d87e02295c7258de3a70ccc;p=qmk_firmware.git diff --git a/tmk_core/common/report.h b/tmk_core/common/report.h index f6c0a315d..899fc524c 100644 --- a/tmk_core/common/report.h +++ b/tmk_core/common/report.h @@ -84,6 +84,11 @@ along with this program. If not, see . # define KEYBOARD_REPORT_SIZE NKRO_EPSIZE # define KEYBOARD_REPORT_KEYS (NKRO_EPSIZE - 2) # define KEYBOARD_REPORT_BITS (NKRO_EPSIZE - 1) +#elif defined(PROTOCOL_CHIBIOS) && defined(NKRO_ENABLE) +# include "protocol/chibios/usb_main.h" +# define KEYBOARD_REPORT_SIZE NKRO_EPSIZE +# define KEYBOARD_REPORT_KEYS (NKRO_EPSIZE - 2) +# define KEYBOARD_REPORT_BITS (NKRO_EPSIZE - 1) #else # define KEYBOARD_REPORT_SIZE 8 @@ -129,13 +134,6 @@ typedef union { } nkro; #endif } __attribute__ ((packed)) report_keyboard_t; -/* -typedef struct { - uint8_t mods; - uint8_t reserved; - uint8_t keys[REPORT_KEYS]; -} __attribute__ ((packed)) report_keyboard_t; -*/ typedef struct { uint8_t buttons; @@ -176,6 +174,20 @@ typedef struct { (key == KC_WWW_REFRESH ? AC_REFRESH : \ (key == KC_WWW_FAVORITES ? AC_BOOKMARKS : 0))))))))))))))))))))) +uint8_t has_anykey(report_keyboard_t* keyboard_report); +uint8_t get_first_key(report_keyboard_t* keyboard_report); + +void add_key_byte(report_keyboard_t* keyboard_report, uint8_t code); +void del_key_byte(report_keyboard_t* keyboard_report, uint8_t code); +#ifdef NKRO_ENABLE +void add_key_bit(report_keyboard_t* keyboard_report, uint8_t code); +void del_key_bit(report_keyboard_t* keyboard_report, uint8_t code); +#endif + +void add_key_to_report(report_keyboard_t* keyboard_report, int8_t key); +void del_key_from_report(report_keyboard_t* keyboard_report, uint8_t key); +void clear_keys_from_report(report_keyboard_t* keyboard_report); + #ifdef __cplusplus } #endif