瀏覽代碼

Workaround for compiler warnings when console disabled.

master
flabbergast 8 年之前
父節點
當前提交
b110884a6d
共有 3 個檔案被更改,包括 12 行新增7 行删除
  1. 6
    4
      tmk_core/common/command.c
  2. 2
    0
      tmk_core/common/nodebug.h
  3. 4
    3
      tmk_core/common/print.h

+ 6
- 4
tmk_core/common/command.c 查看文件

case KC_N: case KC_N:
clear_keyboard(); //Prevents stuck keys. clear_keyboard(); //Prevents stuck keys.
keyboard_nkro = !keyboard_nkro; keyboard_nkro = !keyboard_nkro;
if (keyboard_nkro)
if (keyboard_nkro) {
print("NKRO: on\n"); print("NKRO: on\n");
else
} else {
print("NKRO: off\n"); print("NKRO: off\n");
}
break; break;
#endif #endif
case KC_ESC: case KC_ESC:
print("?"); print("?");
return false; return false;
} }
if (mousekey_param)
if (mousekey_param) {
xprintf("M%d> ", mousekey_param); xprintf("M%d> ", mousekey_param);
else
} else {
print("M>" ); print("M>" );
}
return true; return true;
} }
#endif #endif

+ 2
- 0
tmk_core/common/nodebug.h 查看文件

#ifndef NODEBUG_H #ifndef NODEBUG_H
#define NODEBUG_H 1 #define NODEBUG_H 1


#if !defined(NO_DEBUG)
#define NO_DEBUG #define NO_DEBUG
#endif
#include "debug.h" #include "debug.h"
#undef NO_DEBUG #undef NO_DEBUG



+ 4
- 3
tmk_core/common/print.h 查看文件



#else /* NO_PRINT */ #else /* NO_PRINT */


#define xprintf
#define print
#define println
#define xprintf(s,...)
#define print(s)
#define println(s)
#define print_set_sendchar(func) #define print_set_sendchar(func)
#define print_dec(data) #define print_dec(data)
#define print_decs(data) #define print_decs(data)
#define print_val_bin_reverse8(v) #define print_val_bin_reverse8(v)
#define print_val_bin_reverse16(v) #define print_val_bin_reverse16(v)
#define print_val_bin_reverse32(v) #define print_val_bin_reverse32(v)
#define init_printf(s,ss)


#endif /* NO_PRINT */ #endif /* NO_PRINT */