From 558f3ec1eb325caf706efc15e2fab26121aba442 Mon Sep 17 00:00:00 2001 From: IBNobody Date: Tue, 6 Sep 2016 23:19:01 -0500 Subject: Use keyboard config for nkro (#7) * removing nkro references - wip * changed NKRO to be defined by keymap_config --- keyboards/planck/keymaps/pvc/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'keyboards/planck/keymaps/pvc/Makefile') diff --git a/keyboards/planck/keymaps/pvc/Makefile b/keyboards/planck/keymaps/pvc/Makefile index 0b2f060de..19c3abc6c 100644 --- a/keyboards/planck/keymaps/pvc/Makefile +++ b/keyboards/planck/keymaps/pvc/Makefile @@ -1,9 +1,9 @@ # Build Options -# change to "no" to disable the options, or define them in the Makefile in +# change to "no" to disable the options, or define them in the Makefile in # the appropriate keymap folder that will get included automatically # -BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) MOUSEKEY_ENABLE = yes # Mouse keys(+4700) EXTRAKEY_ENABLE = yes # Audio control and System control(+450) CONSOLE_ENABLE = no # Console for debug(+400) -- cgit v1.2.3 From fe2aed0d1c8d1535c160755b76186972071aed02 Mon Sep 17 00:00:00 2001 From: IBNobody Date: Wed, 7 Sep 2016 23:50:58 -0500 Subject: Added User Print - A "light" console out option (#8) User print disables the normal print messages in the body of QMK/TMK code and is meant as a lightweight alternative to NOPRINT. Use it when you only want to do a spot of debugging but lack flash resources for allowing all of the codebase to print (and store their wasteful strings).--- keyboards/planck/keymaps/pvc/Makefile | 2 +- keyboards/planck/keymaps/pvc/config.h | 12 ++- tmk_core/common/avr/xprintf.h | 6 +- tmk_core/common/mbed/xprintf.cpp | 2 +- tmk_core/common/mbed/xprintf.h | 2 +- tmk_core/common/print.h | 168 ++++++++++++++++++++++++++++++---- 6 files changed, 166 insertions(+), 26 deletions(-) (limited to 'keyboards/planck/keymaps/pvc/Makefile') diff --git a/keyboards/planck/keymaps/pvc/Makefile b/keyboards/planck/keymaps/pvc/Makefile index 19c3abc6c..b2ff961fa 100644 --- a/keyboards/planck/keymaps/pvc/Makefile +++ b/keyboards/planck/keymaps/pvc/Makefile @@ -6,7 +6,7 @@ BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) MOUSEKEY_ENABLE = yes # Mouse keys(+4700) EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) +CONSOLE_ENABLE = yes # Console for debug(+400) COMMAND_ENABLE = yes # Commands for debug and configuration NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality diff --git a/keyboards/planck/keymaps/pvc/config.h b/keyboards/planck/keymaps/pvc/config.h index 1113372b0..1004c8b99 100644 --- a/keyboards/planck/keymaps/pvc/config.h +++ b/keyboards/planck/keymaps/pvc/config.h @@ -68,10 +68,18 @@ along with this program. If not, see . */ /* disable debug print */ -//#define NO_DEBUG +#ifndef NO_DEBUG +# define NO_DEBUG +#endif /* disable print */ -//#define NO_PRINT +// #ifndef NO_PRINT +// # define NO_PRINT +// #endif + +/* Only print user print statements */ +#define USER_PRINT + /* disable action features */ //#define NO_ACTION_LAYER diff --git a/tmk_core/common/avr/xprintf.h b/tmk_core/common/avr/xprintf.h index e53c0dd8e..08d9f93a0 100644 --- a/tmk_core/common/avr/xprintf.h +++ b/tmk_core/common/avr/xprintf.h @@ -56,8 +56,8 @@ void xitoa(long value, char radix, char width); #define xfprintf(func, format, ...) __xfprintf(func, PSTR(format), ##__VA_ARGS__) void __xprintf(const char *format_p, ...); /* Send formatted string to the registered device */ -void __xsprintf(char*, const char *format_p, ...); /* Put formatted string to the memory */ -void __xfprintf(void(*func)(uint8_t), const char *format_p, ...); /* Send formatted string to the specified device */ +// void __xsprintf(char*, const char *format_p, ...); /* Put formatted string to the memory */ +// void __xfprintf(void(*func)(uint8_t), const char *format_p, ...); /* Send formatted string to the specified device */ /* Format string is placed in the ROM. The format flags is similar to printf(). @@ -88,7 +88,7 @@ void __xfprintf(void(*func)(uint8_t), const char *format_p, ...); /* Send format /*-----------------------------------------------------------------------------*/ char xatoi(char **str, long *ret); -/* Get value of the numeral string. +/* Get value of the numeral string. str Pointer to pointer to source string diff --git a/tmk_core/common/mbed/xprintf.cpp b/tmk_core/common/mbed/xprintf.cpp index 3647ece75..b1aac2c99 100644 --- a/tmk_core/common/mbed/xprintf.cpp +++ b/tmk_core/common/mbed/xprintf.cpp @@ -7,7 +7,7 @@ #define STRING_STACK_LIMIT 120 //TODO -int xprintf(const char* format, ...) { return 0; } +int __xprintf(const char* format, ...) { return 0; } #if 0 /* mbed Serial */ diff --git a/tmk_core/common/mbed/xprintf.h b/tmk_core/common/mbed/xprintf.h index 26bc529e5..1e7a48c06 100644 --- a/tmk_core/common/mbed/xprintf.h +++ b/tmk_core/common/mbed/xprintf.h @@ -7,7 +7,7 @@ extern "C" { #endif -int xprintf(const char *format, ...); +int __xprintf(const char *format, ...); #ifdef __cplusplus } diff --git a/tmk_core/common/print.h b/tmk_core/common/print.h index a1352527f..8836c0fc7 100644 --- a/tmk_core/common/print.h +++ b/tmk_core/common/print.h @@ -36,40 +36,140 @@ #ifndef NO_PRINT +#if defined(__AVR__) /* __AVR__ */ -#if defined(__AVR__) +# include "avr/xprintf.h" -#include "avr/xprintf.h" -#define print(s) xputs(PSTR(s)) -#define println(s) xputs(PSTR(s "\r\n")) +# ifdef USER_PRINT /* USER_PRINT */ -#ifdef __cplusplus +// Remove normal print defines +# define print(s) +# define println(s) +# undef xprintf +# define xprintf(fmt, ...) + +// Create user print defines +# define uprint(s) xputs(PSTR(s)) +# define uprintln(s) xputs(PSTR(s "\r\n")) +# define uprintf(fmt, ...) __xprintf(PSTR(fmt), ##__VA_ARGS__) + +# else /* NORMAL PRINT */ + +// Create user & normal print defines +# define print(s) xputs(PSTR(s)) +# define println(s) xputs(PSTR(s "\r\n")) +# define uprint(s) print(s) +# define uprintln(s) println(s) +# define uprintf(fmt, ...) xprintf(fmt, ...) + +# endif /* USER_PRINT / NORMAL PRINT */ + +# ifdef __cplusplus extern "C" -#endif +# endif + /* function pointer of sendchar to be used by print utility */ void print_set_sendchar(int8_t (*print_sendchar_func)(uint8_t)); -#elif defined(PROTOCOL_CHIBIOS) /* __AVR__ */ +#elif defined(PROTOCOL_CHIBIOS) /* PROTOCOL_CHIBIOS */ + +# include "chibios/printf.h" + +# ifdef USER_PRINT /* USER_PRINT */ + +// Remove normal print defines +# define print(s) +# define println(s) +# define xprintf(fmt, ...) + +// Create user print defines +# define uprint(s) printf(s) +# define uprintln(s) printf(s "\r\n") +# define uprintf printf + +# else /* NORMAL PRINT */ + +// Create user & normal print defines +# define print(s) printf(s) +# define println(s) printf(s "\r\n") +# define xprintf printf +# define uprint(s) printf(s) +# define uprintln(s) printf(s "\r\n") +# define uprintf printf -#include "chibios/printf.h" +# endif /* USER_PRINT / NORMAL PRINT */ -#define print(s) printf(s) -#define println(s) printf(s "\r\n") -#define xprintf printf +#elif defined(__arm__) /* __arm__ */ -#elif defined(__arm__) /* __AVR__ */ +# include "mbed/xprintf.h" -#include "mbed/xprintf.h" +# ifdef USER_PRINT /* USER_PRINT */ -#define print(s) xprintf(s) -#define println(s) xprintf(s "\r\n") +// Remove normal print defines +# define print(s) +# define println(s) +# define xprintf(fmt, ...) + +// Create user print defines +# define uprintf(fmt, ...) __xprintf(fmt, ...) +# define uprint(s) xprintf(s) +# define uprintln(s) xprintf(s "\r\n") + +# else /* NORMAL PRINT */ + +// Create user & normal print defines +# define xprintf(fmt, ...) __xprintf(fmt, ...) +# define print(s) xprintf(s) +# define println(s) xprintf(s "\r\n") +# define uprint(s) print(s) +# define uprintln(s) println(s) +# define uprintf(fmt, ...) xprintf(fmt, ...) + +# endif /* USER_PRINT / NORMAL PRINT */ /* TODO: to select output destinations: UART/USBSerial */ -#define print_set_sendchar(func) +# define print_set_sendchar(func) + +#endif /* __AVR__ / PROTOCOL_CHIBIOS / __arm__ */ + +// User print disables the normal print messages in the body of QMK/TMK code and +// is meant as a lightweight alternative to NOPRINT. Use it when you only want to do +// a spot of debugging but lack flash resources for allowing all of the codebase to +// print (and store their wasteful strings). +// +// !!! DO NOT USE USER PRINT CALLS IN THE BODY OF QMK/TMK !!! +// +#ifdef USER_PRINT -#endif /* __AVR__ */ +// Disable normal print +#define print_dec(data) +#define print_decs(data) +#define print_hex4(data) +#define print_hex8(data) +#define print_hex16(data) +#define print_hex32(data) +#define print_bin4(data) +#define print_bin8(data) +#define print_bin16(data) +#define print_bin32(data) +#define print_bin_reverse8(data) +#define print_bin_reverse16(data) +#define print_bin_reverse32(data) +#define print_val_dec(v) +#define print_val_decs(v) +#define print_val_hex8(v) +#define print_val_hex16(v) +#define print_val_hex32(v) +#define print_val_bin8(v) +#define print_val_bin16(v) +#define print_val_bin32(v) +#define print_val_bin_reverse8(v) +#define print_val_bin_reverse16(v) +#define print_val_bin_reverse32(v) +#else /* NORMAL_PRINT */ +//Enable normal print /* decimal */ #define print_dec(i) xprintf("%u", i) #define print_decs(i) xprintf("%d", i) @@ -99,6 +199,39 @@ void print_set_sendchar(int8_t (*print_sendchar_func)(uint8_t)); #define print_val_bin_reverse16(v) xprintf(#v ": %016b\n", bitrev16(v)) #define print_val_bin_reverse32(v) xprintf(#v ": %032lb\n", bitrev32(v)) +#endif /* USER_PRINT / NORMAL_PRINT */ + +// User Print + +/* decimal */ +#define uprint_dec(i) uprintf("%u", i) +#define uprint_decs(i) uprintf("%d", i) +/* hex */ +#define uprint_hex4(i) uprintf("%X", i) +#define uprint_hex8(i) uprintf("%02X", i) +#define uprint_hex16(i) uprintf("%04X", i) +#define uprint_hex32(i) uprintf("%08lX", i) +/* binary */ +#define uprint_bin4(i) uprintf("%04b", i) +#define uprint_bin8(i) uprintf("%08b", i) +#define uprint_bin16(i) uprintf("%016b", i) +#define uprint_bin32(i) uprintf("%032lb", i) +#define uprint_bin_reverse8(i) uprintf("%08b", bitrev(i)) +#define uprint_bin_reverse16(i) uprintf("%016b", bitrev16(i)) +#define uprint_bin_reverse32(i) uprintf("%032lb", bitrev32(i)) +/* print value utility */ +#define uprint_val_dec(v) uprintf(#v ": %u\n", v) +#define uprint_val_decs(v) uprintf(#v ": %d\n", v) +#define uprint_val_hex8(v) uprintf(#v ": %X\n", v) +#define uprint_val_hex16(v) uprintf(#v ": %02X\n", v) +#define uprint_val_hex32(v) uprintf(#v ": %04lX\n", v) +#define uprint_val_bin8(v) uprintf(#v ": %08b\n", v) +#define uprint_val_bin16(v) uprintf(#v ": %016b\n", v) +#define uprint_val_bin32(v) uprintf(#v ": %032lb\n", v) +#define uprint_val_bin_reverse8(v) uprintf(#v ": %08b\n", bitrev(v)) +#define uprint_val_bin_reverse16(v) uprintf(#v ": %016b\n", bitrev16(v)) +#define uprint_val_bin_reverse32(v) uprintf(#v ": %032lb\n", bitrev32(v)) + #else /* NO_PRINT */ #define xprintf(fmt, ...) @@ -143,5 +276,4 @@ void print_set_sendchar(int8_t (*print_sendchar_func)(uint8_t)); #define pbin_reverse(data) print_bin_reverse8(data) #define pbin_reverse16(data) print_bin_reverse16(data) - #endif -- cgit v1.2.3 From cee0cf8a6eca8d2316dd75f39351f13132ff0257 Mon Sep 17 00:00:00 2001 From: cbbrowne Date: Fri, 2 Dec 2016 14:12:55 -0500 Subject: Adds warnings to Planck keymaps that exceed 0x7000 bytes in size #929 --- keyboards/planck/keymaps/jhenahan/Makefile | 4 +++- keyboards/planck/keymaps/joe/Makefile | 5 ++++- keyboards/planck/keymaps/leo/Makefile | 5 ++++- keyboards/planck/keymaps/lucas/Makefile | 5 ++++- keyboards/planck/keymaps/mollat/Makefile | 5 ++++- keyboards/planck/keymaps/nico/Makefile | 5 ++++- keyboards/planck/keymaps/premek/Makefile | 3 +++ keyboards/planck/keymaps/priyadi/Makefile | 3 +++ keyboards/planck/keymaps/pvc/Makefile | 5 ++++- keyboards/planck/keymaps/sgoodwin/Makefile | 5 ++++- keyboards/planck/keymaps/tak3over/Makefile | 5 ++++- keyboards/planck/keymaps/thermal_printer/Makefile | 3 +++ keyboards/planck/keymaps/vifon/Makefile | 3 +++ 13 files changed, 47 insertions(+), 9 deletions(-) (limited to 'keyboards/planck/keymaps/pvc/Makefile') diff --git a/keyboards/planck/keymaps/jhenahan/Makefile b/keyboards/planck/keymaps/jhenahan/Makefile index de01ad240..83da2a7f8 100644 --- a/keyboards/planck/keymaps/jhenahan/Makefile +++ b/keyboards/planck/keymaps/jhenahan/Makefile @@ -1,4 +1,6 @@ - +# Please remove if no longer applicable +$(warning THIS FILE MAY BE TOO LARGE FOR YOUR KEYBOARD) +$(warning Please disable some options in the Makefile to resolve) # Build Options # change to "no" to disable the options, or define them in the Makefile in diff --git a/keyboards/planck/keymaps/joe/Makefile b/keyboards/planck/keymaps/joe/Makefile index 581e08cd0..b2ca41944 100644 --- a/keyboards/planck/keymaps/joe/Makefile +++ b/keyboards/planck/keymaps/joe/Makefile @@ -1,3 +1,6 @@ +# Please remove if no longer applicable +$(warning THIS FILE MAY BE TOO LARGE FOR YOUR KEYBOARD) +$(warning Please disable some options in the Makefile to resolve) # Build Options @@ -22,4 +25,4 @@ SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR include ../../../../Makefile -endif \ No newline at end of file +endif diff --git a/keyboards/planck/keymaps/leo/Makefile b/keyboards/planck/keymaps/leo/Makefile index 581e08cd0..b2ca41944 100644 --- a/keyboards/planck/keymaps/leo/Makefile +++ b/keyboards/planck/keymaps/leo/Makefile @@ -1,3 +1,6 @@ +# Please remove if no longer applicable +$(warning THIS FILE MAY BE TOO LARGE FOR YOUR KEYBOARD) +$(warning Please disable some options in the Makefile to resolve) # Build Options @@ -22,4 +25,4 @@ SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR include ../../../../Makefile -endif \ No newline at end of file +endif diff --git a/keyboards/planck/keymaps/lucas/Makefile b/keyboards/planck/keymaps/lucas/Makefile index 581e08cd0..b2ca41944 100644 --- a/keyboards/planck/keymaps/lucas/Makefile +++ b/keyboards/planck/keymaps/lucas/Makefile @@ -1,3 +1,6 @@ +# Please remove if no longer applicable +$(warning THIS FILE MAY BE TOO LARGE FOR YOUR KEYBOARD) +$(warning Please disable some options in the Makefile to resolve) # Build Options @@ -22,4 +25,4 @@ SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR include ../../../../Makefile -endif \ No newline at end of file +endif diff --git a/keyboards/planck/keymaps/mollat/Makefile b/keyboards/planck/keymaps/mollat/Makefile index 581e08cd0..b2ca41944 100644 --- a/keyboards/planck/keymaps/mollat/Makefile +++ b/keyboards/planck/keymaps/mollat/Makefile @@ -1,3 +1,6 @@ +# Please remove if no longer applicable +$(warning THIS FILE MAY BE TOO LARGE FOR YOUR KEYBOARD) +$(warning Please disable some options in the Makefile to resolve) # Build Options @@ -22,4 +25,4 @@ SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR include ../../../../Makefile -endif \ No newline at end of file +endif diff --git a/keyboards/planck/keymaps/nico/Makefile b/keyboards/planck/keymaps/nico/Makefile index 581e08cd0..b2ca41944 100644 --- a/keyboards/planck/keymaps/nico/Makefile +++ b/keyboards/planck/keymaps/nico/Makefile @@ -1,3 +1,6 @@ +# Please remove if no longer applicable +$(warning THIS FILE MAY BE TOO LARGE FOR YOUR KEYBOARD) +$(warning Please disable some options in the Makefile to resolve) # Build Options @@ -22,4 +25,4 @@ SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR include ../../../../Makefile -endif \ No newline at end of file +endif diff --git a/keyboards/planck/keymaps/premek/Makefile b/keyboards/planck/keymaps/premek/Makefile index 0f4953888..b2ca41944 100644 --- a/keyboards/planck/keymaps/premek/Makefile +++ b/keyboards/planck/keymaps/premek/Makefile @@ -1,3 +1,6 @@ +# Please remove if no longer applicable +$(warning THIS FILE MAY BE TOO LARGE FOR YOUR KEYBOARD) +$(warning Please disable some options in the Makefile to resolve) # Build Options diff --git a/keyboards/planck/keymaps/priyadi/Makefile b/keyboards/planck/keymaps/priyadi/Makefile index aa211d2f0..f113f496c 100644 --- a/keyboards/planck/keymaps/priyadi/Makefile +++ b/keyboards/planck/keymaps/priyadi/Makefile @@ -1,3 +1,6 @@ +# Please remove if no longer applicable +$(warning THIS FILE MAY BE TOO LARGE FOR YOUR KEYBOARD) +$(warning Please disable some options in the Makefile to resolve) # Build Options diff --git a/keyboards/planck/keymaps/pvc/Makefile b/keyboards/planck/keymaps/pvc/Makefile index b2ff961fa..c92ca1bff 100644 --- a/keyboards/planck/keymaps/pvc/Makefile +++ b/keyboards/planck/keymaps/pvc/Makefile @@ -1,3 +1,6 @@ +# Please remove if no longer applicable +$(warning THIS FILE MAY BE TOO LARGE FOR YOUR KEYBOARD) +$(warning Please disable some options in the Makefile to resolve) # Build Options # change to "no" to disable the options, or define them in the Makefile in @@ -21,4 +24,4 @@ SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR include ../../../../Makefile -endif \ No newline at end of file +endif diff --git a/keyboards/planck/keymaps/sgoodwin/Makefile b/keyboards/planck/keymaps/sgoodwin/Makefile index 581e08cd0..b2ca41944 100644 --- a/keyboards/planck/keymaps/sgoodwin/Makefile +++ b/keyboards/planck/keymaps/sgoodwin/Makefile @@ -1,3 +1,6 @@ +# Please remove if no longer applicable +$(warning THIS FILE MAY BE TOO LARGE FOR YOUR KEYBOARD) +$(warning Please disable some options in the Makefile to resolve) # Build Options @@ -22,4 +25,4 @@ SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR include ../../../../Makefile -endif \ No newline at end of file +endif diff --git a/keyboards/planck/keymaps/tak3over/Makefile b/keyboards/planck/keymaps/tak3over/Makefile index 581e08cd0..b2ca41944 100644 --- a/keyboards/planck/keymaps/tak3over/Makefile +++ b/keyboards/planck/keymaps/tak3over/Makefile @@ -1,3 +1,6 @@ +# Please remove if no longer applicable +$(warning THIS FILE MAY BE TOO LARGE FOR YOUR KEYBOARD) +$(warning Please disable some options in the Makefile to resolve) # Build Options @@ -22,4 +25,4 @@ SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR include ../../../../Makefile -endif \ No newline at end of file +endif diff --git a/keyboards/planck/keymaps/thermal_printer/Makefile b/keyboards/planck/keymaps/thermal_printer/Makefile index 3d1d11877..9477d1179 100644 --- a/keyboards/planck/keymaps/thermal_printer/Makefile +++ b/keyboards/planck/keymaps/thermal_printer/Makefile @@ -1,3 +1,6 @@ +# Please remove if no longer applicable +$(warning THIS FILE MAY BE TOO LARGE FOR YOUR KEYBOARD) +$(warning Please disable some options in the Makefile to resolve) # Build Options diff --git a/keyboards/planck/keymaps/vifon/Makefile b/keyboards/planck/keymaps/vifon/Makefile index 838cb4e88..53660a2e7 100644 --- a/keyboards/planck/keymaps/vifon/Makefile +++ b/keyboards/planck/keymaps/vifon/Makefile @@ -1,3 +1,6 @@ +# Please remove if no longer applicable +$(warning THIS FILE MAY BE TOO LARGE FOR YOUR KEYBOARD) +$(warning Please disable some options in the Makefile to resolve) # Build Options -- cgit v1.2.3