1
0
Fork 0

Make NKRO deafult when it is available

- NKRO is used only when keyboard_protocol = 1(report)
This commit is contained in:
tmk 2014-04-25 15:32:21 +09:00
parent 62117e7ea7
commit 5e3f2d2b2e
8 changed files with 51 additions and 50 deletions

View file

@ -67,7 +67,7 @@ void send_keyboard_report(void) {
void add_key(uint8_t key)
{
#ifdef NKRO_ENABLE
if (keyboard_nkro) {
if (keyboard_nkro && keyboard_protocol) {
add_key_bit(key);
return;
}
@ -78,7 +78,7 @@ void add_key(uint8_t key)
void del_key(uint8_t key)
{
#ifdef NKRO_ENABLE
if (keyboard_nkro) {
if (keyboard_nkro && keyboard_protocol) {
del_key_bit(key);
return;
}
@ -151,7 +151,7 @@ uint8_t has_anymod(void)
uint8_t get_first_key(void)
{
#ifdef NKRO_ENABLE
if (keyboard_nkro) {
if (keyboard_nkro && keyboard_protocol) {
uint8_t i = 0;
for (; i < REPORT_BITS && !keyboard_report->nkro.bits[i]; i++)
;

View file

@ -301,13 +301,13 @@ static bool command_common(uint8_t code)
case KC_S:
print("\n\n----- Status -----\n");
print_val_hex8(host_keyboard_leds());
print_val_hex8(keyboard_protocol);
print_val_hex8(keyboard_idle);
#ifdef PROTOCOL_PJRC
print_val_hex8(UDCON);
print_val_hex8(UDIEN);
print_val_hex8(UDINT);
print_val_hex8(usb_keyboard_leds);
print_val_hex8(usb_keyboard_protocol);
print_val_hex8(usb_keyboard_idle_config);
print_val_hex8(usb_keyboard_idle_count);
#endif

View file

@ -24,7 +24,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifdef NKRO_ENABLE
bool keyboard_nkro = false;
bool keyboard_nkro = true;
#endif
static host_driver_t *driver;

View file

@ -32,6 +32,9 @@ extern "C" {
extern bool keyboard_nkro;
#endif
uint8_t keyboard_idle;
uint8_t keyboard_protocol;
/* host driver */
void host_set_driver(host_driver_t *driver);