X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=tmk_core%2Fcommon%2Freport.h;h=6c27eb9dc6509b4052f97e21c01b16357c005f7a;hb=700aa8fe1c5775ba26358c343c122997225fafcc;hp=899fc524cbdb2a159ef5e97eb4e5463b9b912885;hpb=fb95d86b39074b581455fb35a17477cce79a3738;p=qmk_firmware.git diff --git a/tmk_core/common/report.h b/tmk_core/common/report.h index 899fc524c..6c27eb9dc 100644 --- a/tmk_core/common/report.h +++ b/tmk_core/common/report.h @@ -73,22 +73,20 @@ along with this program. If not, see . /* key report size(NKRO or boot mode) */ -#if defined(PROTOCOL_PJRC) && defined(NKRO_ENABLE) -# include "usb.h" -# define KEYBOARD_REPORT_SIZE KBD2_SIZE -# define KEYBOARD_REPORT_KEYS (KBD2_SIZE - 2) -# define KEYBOARD_REPORT_BITS (KBD2_SIZE - 1) - -#elif defined(PROTOCOL_LUFA) && defined(NKRO_ENABLE) -# include "protocol/lufa/descriptor.h" -# 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) +#if defined(NKRO_ENABLE) + #if defined(PROTOCOL_PJRC) + #include "usb.h" + #define KEYBOARD_REPORT_SIZE KBD2_SIZE + #define KEYBOARD_REPORT_KEYS (KBD2_SIZE - 2) + #define KEYBOARD_REPORT_BITS (KBD2_SIZE - 1) + #elif defined(PROTOCOL_LUFA) || defined(PROTOCOL_CHIBIOS) + #include "protocol/usb_descriptor.h" + #define KEYBOARD_REPORT_SIZE NKRO_EPSIZE + #define KEYBOARD_REPORT_KEYS (NKRO_EPSIZE - 2) + #define KEYBOARD_REPORT_BITS (NKRO_EPSIZE - 1) + #else + #error "NKRO not supported with this protocol" +#endif #else # define KEYBOARD_REPORT_SIZE 8 @@ -184,7 +182,7 @@ 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 add_key_to_report(report_keyboard_t* keyboard_report, uint8_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);