]> git.donarmstrong.com Git - qmk_firmware.git/blobdiff - tmk_core/common/report.h
Tidy up keycode.h (#3666)
[qmk_firmware.git] / tmk_core / common / report.h
index 899fc524cbdb2a159ef5e97eb4e5463b9b912885..6c27eb9dc6509b4052f97e21c01b16357c005f7a 100644 (file)
@@ -73,22 +73,20 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 
 /* 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);