You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

135 lines
5.2 KiB

Massdrop keyboard support (#3780) * Massdrop SAMD51 Massdrop SAMD51 keyboards initial project upload * Removing relocated files Removing files that were relocated and not deleted from previous location * LED queue fix and cleaning Cleaned some white space or comments. Fix for LED I2C command queue. Cleaned up interrupts. Added debug function for printing numbers to scope through m15 line. * Factory programmed serial usage Ability to use factory programmed serial in hub and keyboard usb descriptors * USB serial number and bugfix Added support for factory programmed serial and usage. Incorporated bootloader's conditional compiling to align project closer. Fixed issue when USB device attempted to send before enabled. General white space and comment cleanup. * Project cleanup Cleaned up project in terms of white space, commented code, and unecessary files. NKRO keyboard is now using correct setreport although KBD was fine to use. Fixed broken linkage to __xprintf for serial debug statements. * Fix for extra keys Fixed possible USB hang on extra keys report set missing * I2C cleanup I2C cleanup and file renames necessary for master branch merge * Boot tracing and clocks cleanup Added optional boot debug trace mode through debug LED codes. General clock code cleanup. * Relocate ARM/Atmel headers Moved ARM/Atmel header folder from drivers to lib and made necessary makefile changes. * Pull request changes Pull request changes * Keymap and compile flag fix Keymap fix for momentary layer. Potential compile flag fix for Travis CI failure. * va_list include fix Fix for va_list compile failure * Include file case fixes Fixes for include files with incorrect case * ctrl and alt67 keyboard readme Added ctrl and alt67 keyboard readme files
5 years ago
Massdrop keyboard support (#3780) * Massdrop SAMD51 Massdrop SAMD51 keyboards initial project upload * Removing relocated files Removing files that were relocated and not deleted from previous location * LED queue fix and cleaning Cleaned some white space or comments. Fix for LED I2C command queue. Cleaned up interrupts. Added debug function for printing numbers to scope through m15 line. * Factory programmed serial usage Ability to use factory programmed serial in hub and keyboard usb descriptors * USB serial number and bugfix Added support for factory programmed serial and usage. Incorporated bootloader's conditional compiling to align project closer. Fixed issue when USB device attempted to send before enabled. General white space and comment cleanup. * Project cleanup Cleaned up project in terms of white space, commented code, and unecessary files. NKRO keyboard is now using correct setreport although KBD was fine to use. Fixed broken linkage to __xprintf for serial debug statements. * Fix for extra keys Fixed possible USB hang on extra keys report set missing * I2C cleanup I2C cleanup and file renames necessary for master branch merge * Boot tracing and clocks cleanup Added optional boot debug trace mode through debug LED codes. General clock code cleanup. * Relocate ARM/Atmel headers Moved ARM/Atmel header folder from drivers to lib and made necessary makefile changes. * Pull request changes Pull request changes * Keymap and compile flag fix Keymap fix for momentary layer. Potential compile flag fix for Travis CI failure. * va_list include fix Fix for va_list compile failure * Include file case fixes Fixes for include files with incorrect case * ctrl and alt67 keyboard readme Added ctrl and alt67 keyboard readme files
5 years ago
Massdrop keyboard support (#3780) * Massdrop SAMD51 Massdrop SAMD51 keyboards initial project upload * Removing relocated files Removing files that were relocated and not deleted from previous location * LED queue fix and cleaning Cleaned some white space or comments. Fix for LED I2C command queue. Cleaned up interrupts. Added debug function for printing numbers to scope through m15 line. * Factory programmed serial usage Ability to use factory programmed serial in hub and keyboard usb descriptors * USB serial number and bugfix Added support for factory programmed serial and usage. Incorporated bootloader's conditional compiling to align project closer. Fixed issue when USB device attempted to send before enabled. General white space and comment cleanup. * Project cleanup Cleaned up project in terms of white space, commented code, and unecessary files. NKRO keyboard is now using correct setreport although KBD was fine to use. Fixed broken linkage to __xprintf for serial debug statements. * Fix for extra keys Fixed possible USB hang on extra keys report set missing * I2C cleanup I2C cleanup and file renames necessary for master branch merge * Boot tracing and clocks cleanup Added optional boot debug trace mode through debug LED codes. General clock code cleanup. * Relocate ARM/Atmel headers Moved ARM/Atmel header folder from drivers to lib and made necessary makefile changes. * Pull request changes Pull request changes * Keymap and compile flag fix Keymap fix for momentary layer. Potential compile flag fix for Travis CI failure. * va_list include fix Fix for va_list compile failure * Include file case fixes Fixes for include files with incorrect case * ctrl and alt67 keyboard readme Added ctrl and alt67 keyboard readme files
5 years ago
Massdrop keyboard support (#3780) * Massdrop SAMD51 Massdrop SAMD51 keyboards initial project upload * Removing relocated files Removing files that were relocated and not deleted from previous location * LED queue fix and cleaning Cleaned some white space or comments. Fix for LED I2C command queue. Cleaned up interrupts. Added debug function for printing numbers to scope through m15 line. * Factory programmed serial usage Ability to use factory programmed serial in hub and keyboard usb descriptors * USB serial number and bugfix Added support for factory programmed serial and usage. Incorporated bootloader's conditional compiling to align project closer. Fixed issue when USB device attempted to send before enabled. General white space and comment cleanup. * Project cleanup Cleaned up project in terms of white space, commented code, and unecessary files. NKRO keyboard is now using correct setreport although KBD was fine to use. Fixed broken linkage to __xprintf for serial debug statements. * Fix for extra keys Fixed possible USB hang on extra keys report set missing * I2C cleanup I2C cleanup and file renames necessary for master branch merge * Boot tracing and clocks cleanup Added optional boot debug trace mode through debug LED codes. General clock code cleanup. * Relocate ARM/Atmel headers Moved ARM/Atmel header folder from drivers to lib and made necessary makefile changes. * Pull request changes Pull request changes * Keymap and compile flag fix Keymap fix for momentary layer. Potential compile flag fix for Travis CI failure. * va_list include fix Fix for va_list compile failure * Include file case fixes Fixes for include files with incorrect case * ctrl and alt67 keyboard readme Added ctrl and alt67 keyboard readme files
5 years ago
Massdrop keyboard support (#3780) * Massdrop SAMD51 Massdrop SAMD51 keyboards initial project upload * Removing relocated files Removing files that were relocated and not deleted from previous location * LED queue fix and cleaning Cleaned some white space or comments. Fix for LED I2C command queue. Cleaned up interrupts. Added debug function for printing numbers to scope through m15 line. * Factory programmed serial usage Ability to use factory programmed serial in hub and keyboard usb descriptors * USB serial number and bugfix Added support for factory programmed serial and usage. Incorporated bootloader's conditional compiling to align project closer. Fixed issue when USB device attempted to send before enabled. General white space and comment cleanup. * Project cleanup Cleaned up project in terms of white space, commented code, and unecessary files. NKRO keyboard is now using correct setreport although KBD was fine to use. Fixed broken linkage to __xprintf for serial debug statements. * Fix for extra keys Fixed possible USB hang on extra keys report set missing * I2C cleanup I2C cleanup and file renames necessary for master branch merge * Boot tracing and clocks cleanup Added optional boot debug trace mode through debug LED codes. General clock code cleanup. * Relocate ARM/Atmel headers Moved ARM/Atmel header folder from drivers to lib and made necessary makefile changes. * Pull request changes Pull request changes * Keymap and compile flag fix Keymap fix for momentary layer. Potential compile flag fix for Travis CI failure. * va_list include fix Fix for va_list compile failure * Include file case fixes Fixes for include files with incorrect case * ctrl and alt67 keyboard readme Added ctrl and alt67 keyboard readme files
5 years ago
  1. /* Copyright 2012 Jun Wako <wakojun@gmail.com> */
  2. /* Very basic print functions, intended to be used with usb_debug_only.c
  3. * http://www.pjrc.com/teensy/
  4. * Copyright (c) 2008 PJRC.COM, LLC
  5. *
  6. * Permission is hereby granted, free of charge, to any person obtaining a copy
  7. * of this software and associated documentation files (the "Software"), to deal
  8. * in the Software without restriction, including without limitation the rights
  9. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  10. * copies of the Software, and to permit persons to whom the Software is
  11. * furnished to do so, subject to the following conditions:
  12. *
  13. * The above copyright notice and this permission notice shall be included in
  14. * all copies or substantial portions of the Software.
  15. *
  16. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  20. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  21. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  22. * THE SOFTWARE.
  23. */
  24. #pragma once
  25. #include <stdint.h>
  26. #include <stdbool.h>
  27. #include "util.h"
  28. #include "sendchar.h"
  29. #include "progmem.h"
  30. void print_set_sendchar(sendchar_func_t func);
  31. #ifndef NO_PRINT
  32. # if __has_include_next("_print.h")
  33. # include_next "_print.h" /* Include the platforms print.h */
  34. # else
  35. // Fall back to lib/printf
  36. # include "printf.h" // lib/printf/printf.h
  37. // Create user & normal print defines
  38. # define print(s) printf(s)
  39. # define println(s) printf(s "\r\n")
  40. # define xprintf printf
  41. # define uprint(s) printf(s)
  42. # define uprintln(s) printf(s "\r\n")
  43. # define uprintf printf
  44. # endif /* __has_include_next("_print.h") */
  45. #else /* NO_PRINT */
  46. # undef xprintf
  47. // Remove print defines
  48. # define print(s)
  49. # define println(s)
  50. # define xprintf(fmt, ...)
  51. # define uprintf(fmt, ...)
  52. # define uprint(s)
  53. # define uprintln(s)
  54. #endif /* NO_PRINT */
  55. #ifdef USER_PRINT
  56. // Remove normal print defines
  57. # undef print
  58. # undef println
  59. # undef xprintf
  60. # define print(s)
  61. # define println(s)
  62. # define xprintf(fmt, ...)
  63. #endif
  64. #define print_dec(i) xprintf("%u", i)
  65. #define print_decs(i) xprintf("%d", i)
  66. /* hex */
  67. #define print_hex4(i) xprintf("%X", i)
  68. #define print_hex8(i) xprintf("%02X", i)
  69. #define print_hex16(i) xprintf("%04X", i)
  70. #define print_hex32(i) xprintf("%08lX", i)
  71. /* binary */
  72. #define print_bin4(i) xprintf("%04b", i)
  73. #define print_bin8(i) xprintf("%08b", i)
  74. #define print_bin16(i) xprintf("%016b", i)
  75. #define print_bin32(i) xprintf("%032lb", i)
  76. #define print_bin_reverse8(i) xprintf("%08b", bitrev(i))
  77. #define print_bin_reverse16(i) xprintf("%016b", bitrev16(i))
  78. #define print_bin_reverse32(i) xprintf("%032lb", bitrev32(i))
  79. /* print value utility */
  80. #define print_val_dec(v) xprintf(#v ": %u\n", v)
  81. #define print_val_decs(v) xprintf(#v ": %d\n", v)
  82. #define print_val_hex8(v) xprintf(#v ": %X\n", v)
  83. #define print_val_hex16(v) xprintf(#v ": %02X\n", v)
  84. #define print_val_hex32(v) xprintf(#v ": %04lX\n", v)
  85. #define print_val_bin8(v) xprintf(#v ": %08b\n", v)
  86. #define print_val_bin16(v) xprintf(#v ": %016b\n", v)
  87. #define print_val_bin32(v) xprintf(#v ": %032lb\n", v)
  88. #define print_val_bin_reverse8(v) xprintf(#v ": %08b\n", bitrev(v))
  89. #define print_val_bin_reverse16(v) xprintf(#v ": %016b\n", bitrev16(v))
  90. #define print_val_bin_reverse32(v) xprintf(#v ": %032lb\n", bitrev32(v))
  91. // User print disables the normal print messages in the body of QMK/TMK code and
  92. // is meant as a lightweight alternative to NOPRINT. Use it when you only want to do
  93. // a spot of debugging but lack flash resources for allowing all of the codebase to
  94. // print (and store their wasteful strings).
  95. //
  96. // !!! DO NOT USE USER PRINT CALLS IN THE BODY OF QMK/TMK !!!
  97. /* decimal */
  98. #define uprint_dec(i) uprintf("%u", i)
  99. #define uprint_decs(i) uprintf("%d", i)
  100. /* hex */
  101. #define uprint_hex4(i) uprintf("%X", i)
  102. #define uprint_hex8(i) uprintf("%02X", i)
  103. #define uprint_hex16(i) uprintf("%04X", i)
  104. #define uprint_hex32(i) uprintf("%08lX", i)
  105. /* binary */
  106. #define uprint_bin4(i) uprintf("%04b", i)
  107. #define uprint_bin8(i) uprintf("%08b", i)
  108. #define uprint_bin16(i) uprintf("%016b", i)
  109. #define uprint_bin32(i) uprintf("%032lb", i)
  110. #define uprint_bin_reverse8(i) uprintf("%08b", bitrev(i))
  111. #define uprint_bin_reverse16(i) uprintf("%016b", bitrev16(i))
  112. #define uprint_bin_reverse32(i) uprintf("%032lb", bitrev32(i))
  113. /* print value utility */
  114. #define uprint_val_dec(v) uprintf(#v ": %u\n", v)
  115. #define uprint_val_decs(v) uprintf(#v ": %d\n", v)
  116. #define uprint_val_hex8(v) uprintf(#v ": %X\n", v)
  117. #define uprint_val_hex16(v) uprintf(#v ": %02X\n", v)
  118. #define uprint_val_hex32(v) uprintf(#v ": %04lX\n", v)
  119. #define uprint_val_bin8(v) uprintf(#v ": %08b\n", v)
  120. #define uprint_val_bin16(v) uprintf(#v ": %016b\n", v)
  121. #define uprint_val_bin32(v) uprintf(#v ": %032lb\n", v)
  122. #define uprint_val_bin_reverse8(v) uprintf(#v ": %08b\n", bitrev(v))
  123. #define uprint_val_bin_reverse16(v) uprintf(#v ": %016b\n", bitrev16(v))
  124. #define uprint_val_bin_reverse32(v) uprintf(#v ": %032lb\n", bitrev32(v))