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.

214 lines
6.1 KiB

[Keyboard] add support for ModelM USB board (#9846) * add support for ModelM USB board * EMI improvement: remove unnecessary toggling of MOSI pin * address review comments * Update keyboards/mschwingen/modelm/rules.mk Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/mschwingen/modelm/rules.mk Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/mschwingen/modelm/config.h Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/mschwingen/modelm/config.h Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/mschwingen/modelm/rules.mk Co-authored-by: Drashna Jaelre <drashna@live.com> * Update keyboards/mschwingen/modelm/keymaps/default/keymap.c Co-authored-by: Drashna Jaelre <drashna@live.com> * update printf usage * add comment * EMI improvement: remove unnecessary toggling of MOSI signal * remove trailing space * use shorter macros as suggested in review by noroadsleft, re-format table to line up columns * Update keyboards/mschwingen/modelm/config.h Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mschwingen/modelm/rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mschwingen/modelm/rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mschwingen/modelm/rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mschwingen/modelm/README.md Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mschwingen/modelm/README.md Co-authored-by: Ryan <fauxpark@gmail.com> * Apply suggestions from code review use spi_read from core insteads of our own copy Co-authored-by: Ryan <fauxpark@gmail.com> * include spi_master.c to use spi_read() * Update keyboards/mschwingen/modelm/README.md Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> * Apply suggestions from code review: correct indenting in keymap Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> * Apply suggestions from code review use automatic variant defines from makefile instead of defining our own Co-authored-by: Drashna Jaelre <drashna@live.com> * Update keyboards/mschwingen/modelm/rules.mk: use QUANTUM_LIB_SRC for uart.c Co-authored-by: Drashna Jaelre <drashna@live.com> Co-authored-by: Michael Schwingen <michael@schwingen.org> Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> Co-authored-by: Drashna Jaelre <drashna@live.com> Co-authored-by: Ryan <fauxpark@gmail.com>
3 years ago
[Keyboard] add support for ModelM USB board (#9846) * add support for ModelM USB board * EMI improvement: remove unnecessary toggling of MOSI pin * address review comments * Update keyboards/mschwingen/modelm/rules.mk Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/mschwingen/modelm/rules.mk Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/mschwingen/modelm/config.h Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/mschwingen/modelm/config.h Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/mschwingen/modelm/rules.mk Co-authored-by: Drashna Jaelre <drashna@live.com> * Update keyboards/mschwingen/modelm/keymaps/default/keymap.c Co-authored-by: Drashna Jaelre <drashna@live.com> * update printf usage * add comment * EMI improvement: remove unnecessary toggling of MOSI signal * remove trailing space * use shorter macros as suggested in review by noroadsleft, re-format table to line up columns * Update keyboards/mschwingen/modelm/config.h Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mschwingen/modelm/rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mschwingen/modelm/rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mschwingen/modelm/rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mschwingen/modelm/README.md Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mschwingen/modelm/README.md Co-authored-by: Ryan <fauxpark@gmail.com> * Apply suggestions from code review use spi_read from core insteads of our own copy Co-authored-by: Ryan <fauxpark@gmail.com> * include spi_master.c to use spi_read() * Update keyboards/mschwingen/modelm/README.md Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> * Apply suggestions from code review: correct indenting in keymap Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> * Apply suggestions from code review use automatic variant defines from makefile instead of defining our own Co-authored-by: Drashna Jaelre <drashna@live.com> * Update keyboards/mschwingen/modelm/rules.mk: use QUANTUM_LIB_SRC for uart.c Co-authored-by: Drashna Jaelre <drashna@live.com> Co-authored-by: Michael Schwingen <michael@schwingen.org> Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> Co-authored-by: Drashna Jaelre <drashna@live.com> Co-authored-by: Ryan <fauxpark@gmail.com>
3 years ago
[Keyboard] add support for ModelM USB board (#9846) * add support for ModelM USB board * EMI improvement: remove unnecessary toggling of MOSI pin * address review comments * Update keyboards/mschwingen/modelm/rules.mk Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/mschwingen/modelm/rules.mk Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/mschwingen/modelm/config.h Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/mschwingen/modelm/config.h Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/mschwingen/modelm/rules.mk Co-authored-by: Drashna Jaelre <drashna@live.com> * Update keyboards/mschwingen/modelm/keymaps/default/keymap.c Co-authored-by: Drashna Jaelre <drashna@live.com> * update printf usage * add comment * EMI improvement: remove unnecessary toggling of MOSI signal * remove trailing space * use shorter macros as suggested in review by noroadsleft, re-format table to line up columns * Update keyboards/mschwingen/modelm/config.h Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mschwingen/modelm/rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mschwingen/modelm/rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mschwingen/modelm/rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mschwingen/modelm/README.md Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mschwingen/modelm/README.md Co-authored-by: Ryan <fauxpark@gmail.com> * Apply suggestions from code review use spi_read from core insteads of our own copy Co-authored-by: Ryan <fauxpark@gmail.com> * include spi_master.c to use spi_read() * Update keyboards/mschwingen/modelm/README.md Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> * Apply suggestions from code review: correct indenting in keymap Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> * Apply suggestions from code review use automatic variant defines from makefile instead of defining our own Co-authored-by: Drashna Jaelre <drashna@live.com> * Update keyboards/mschwingen/modelm/rules.mk: use QUANTUM_LIB_SRC for uart.c Co-authored-by: Drashna Jaelre <drashna@live.com> Co-authored-by: Michael Schwingen <michael@schwingen.org> Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> Co-authored-by: Drashna Jaelre <drashna@live.com> Co-authored-by: Ryan <fauxpark@gmail.com>
3 years ago
[Keyboard] add support for ModelM USB board (#9846) * add support for ModelM USB board * EMI improvement: remove unnecessary toggling of MOSI pin * address review comments * Update keyboards/mschwingen/modelm/rules.mk Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/mschwingen/modelm/rules.mk Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/mschwingen/modelm/config.h Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/mschwingen/modelm/config.h Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/mschwingen/modelm/rules.mk Co-authored-by: Drashna Jaelre <drashna@live.com> * Update keyboards/mschwingen/modelm/keymaps/default/keymap.c Co-authored-by: Drashna Jaelre <drashna@live.com> * update printf usage * add comment * EMI improvement: remove unnecessary toggling of MOSI signal * remove trailing space * use shorter macros as suggested in review by noroadsleft, re-format table to line up columns * Update keyboards/mschwingen/modelm/config.h Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mschwingen/modelm/rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mschwingen/modelm/rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mschwingen/modelm/rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mschwingen/modelm/README.md Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mschwingen/modelm/README.md Co-authored-by: Ryan <fauxpark@gmail.com> * Apply suggestions from code review use spi_read from core insteads of our own copy Co-authored-by: Ryan <fauxpark@gmail.com> * include spi_master.c to use spi_read() * Update keyboards/mschwingen/modelm/README.md Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> * Apply suggestions from code review: correct indenting in keymap Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> * Apply suggestions from code review use automatic variant defines from makefile instead of defining our own Co-authored-by: Drashna Jaelre <drashna@live.com> * Update keyboards/mschwingen/modelm/rules.mk: use QUANTUM_LIB_SRC for uart.c Co-authored-by: Drashna Jaelre <drashna@live.com> Co-authored-by: Michael Schwingen <michael@schwingen.org> Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> Co-authored-by: Drashna Jaelre <drashna@live.com> Co-authored-by: Ryan <fauxpark@gmail.com>
3 years ago
[Keyboard] add support for ModelM USB board (#9846) * add support for ModelM USB board * EMI improvement: remove unnecessary toggling of MOSI pin * address review comments * Update keyboards/mschwingen/modelm/rules.mk Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/mschwingen/modelm/rules.mk Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/mschwingen/modelm/config.h Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/mschwingen/modelm/config.h Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/mschwingen/modelm/rules.mk Co-authored-by: Drashna Jaelre <drashna@live.com> * Update keyboards/mschwingen/modelm/keymaps/default/keymap.c Co-authored-by: Drashna Jaelre <drashna@live.com> * update printf usage * add comment * EMI improvement: remove unnecessary toggling of MOSI signal * remove trailing space * use shorter macros as suggested in review by noroadsleft, re-format table to line up columns * Update keyboards/mschwingen/modelm/config.h Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mschwingen/modelm/rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mschwingen/modelm/rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mschwingen/modelm/rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mschwingen/modelm/README.md Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mschwingen/modelm/README.md Co-authored-by: Ryan <fauxpark@gmail.com> * Apply suggestions from code review use spi_read from core insteads of our own copy Co-authored-by: Ryan <fauxpark@gmail.com> * include spi_master.c to use spi_read() * Update keyboards/mschwingen/modelm/README.md Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> * Apply suggestions from code review: correct indenting in keymap Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> * Apply suggestions from code review use automatic variant defines from makefile instead of defining our own Co-authored-by: Drashna Jaelre <drashna@live.com> * Update keyboards/mschwingen/modelm/rules.mk: use QUANTUM_LIB_SRC for uart.c Co-authored-by: Drashna Jaelre <drashna@live.com> Co-authored-by: Michael Schwingen <michael@schwingen.org> Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> Co-authored-by: Drashna Jaelre <drashna@live.com> Co-authored-by: Ryan <fauxpark@gmail.com>
3 years ago
[Keyboard] add support for ModelM USB board (#9846) * add support for ModelM USB board * EMI improvement: remove unnecessary toggling of MOSI pin * address review comments * Update keyboards/mschwingen/modelm/rules.mk Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/mschwingen/modelm/rules.mk Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/mschwingen/modelm/config.h Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/mschwingen/modelm/config.h Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/mschwingen/modelm/rules.mk Co-authored-by: Drashna Jaelre <drashna@live.com> * Update keyboards/mschwingen/modelm/keymaps/default/keymap.c Co-authored-by: Drashna Jaelre <drashna@live.com> * update printf usage * add comment * EMI improvement: remove unnecessary toggling of MOSI signal * remove trailing space * use shorter macros as suggested in review by noroadsleft, re-format table to line up columns * Update keyboards/mschwingen/modelm/config.h Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mschwingen/modelm/rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mschwingen/modelm/rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mschwingen/modelm/rules.mk Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mschwingen/modelm/README.md Co-authored-by: Ryan <fauxpark@gmail.com> * Update keyboards/mschwingen/modelm/README.md Co-authored-by: Ryan <fauxpark@gmail.com> * Apply suggestions from code review use spi_read from core insteads of our own copy Co-authored-by: Ryan <fauxpark@gmail.com> * include spi_master.c to use spi_read() * Update keyboards/mschwingen/modelm/README.md Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> * Apply suggestions from code review: correct indenting in keymap Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> * Apply suggestions from code review use automatic variant defines from makefile instead of defining our own Co-authored-by: Drashna Jaelre <drashna@live.com> * Update keyboards/mschwingen/modelm/rules.mk: use QUANTUM_LIB_SRC for uart.c Co-authored-by: Drashna Jaelre <drashna@live.com> Co-authored-by: Michael Schwingen <michael@schwingen.org> Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> Co-authored-by: Drashna Jaelre <drashna@live.com> Co-authored-by: Ryan <fauxpark@gmail.com>
3 years ago
  1. /*
  2. * Copyright 2020 Michael Schwingen
  3. * This program is free software: you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License as published by
  5. * the Free Software Foundation, either version 2 of the License, or
  6. * (at your option) any later version.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public License
  14. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. #include <util/delay.h>
  17. #include "modelm.h"
  18. #include "uart.h"
  19. #include "print.h"
  20. #include "sendchar.h"
  21. #include "ws2812.h"
  22. #include "modelm.h"
  23. #include "sleep_led.h"
  24. #ifdef UART_DEBUG
  25. # undef sendchar
  26. static int8_t capture_sendchar(uint8_t c) {
  27. // sendchar(c);
  28. uart_putchar(c);
  29. return 0;
  30. }
  31. #endif
  32. static uint16_t blink_cycle_timer;
  33. static bool blink_state = false;
  34. static uint8_t isRecording = 0;
  35. #ifdef KEYBOARD_mschwingen_modelm_led_ws2812
  36. # if RGBLED_NUM < 3
  37. # error we need at least 3 RGB LEDs!
  38. # endif
  39. static cRGB led[RGBLED_NUM] = {{255, 255, 255}, {255, 255, 255}, {255, 255, 255}};
  40. # define BRIGHT 32
  41. # define DIM 6
  42. static const cRGB black = {.r = 0, .g = 0, .b = 0};
  43. static const __attribute__((unused)) cRGB green = {.r = 0, .g = BRIGHT, .b = 0};
  44. static const __attribute__((unused)) cRGB lgreen = {.r = 0, .g = DIM, .b = 0};
  45. static const __attribute__((unused)) cRGB red = {.r = BRIGHT, .g = 0, .b = 0};
  46. static const __attribute__((unused)) cRGB lred = {.r = DIM, .g = 0, .b = 0};
  47. static const __attribute__((unused)) cRGB blue = {.r = 0, .g = 0, .b = BRIGHT};
  48. static const __attribute__((unused)) cRGB lblue = {.r = 0, .g = 0, .b = DIM};
  49. static const __attribute__((unused)) cRGB turq = {.r = 0, .g = BRIGHT, .b = BRIGHT};
  50. static const __attribute__((unused)) cRGB lturq = {.r = 0, .g = DIM, .b = DIM};
  51. static const __attribute__((unused)) cRGB white = {.r = BRIGHT, .g = BRIGHT, .b = BRIGHT};
  52. static led_t led_state;
  53. static uint8_t layer;
  54. static uint8_t default_layer;
  55. #endif
  56. // we need our own sleep_led_* implementation to get callbacks on USB
  57. // suspend/resume in order to completely turn off WS2812 LEDs
  58. static bool suspend_active = false;
  59. void sleep_led_init(void) {}
  60. void sleep_led_toggle(void) {}
  61. void sleep_led_disable(void) {
  62. suspend_active = false;
  63. writePinHigh(QMK_LED);
  64. }
  65. void sleep_led_enable(void) {
  66. suspend_active = true;
  67. writePinLow(QMK_LED);
  68. #ifdef KEYBOARD_mschwingen_modelm_led_ws2812
  69. led[0] = black;
  70. led[1] = black;
  71. led[2] = black;
  72. ws2812_setleds(led, RGBLED_NUM);
  73. #endif
  74. }
  75. void keyboard_pre_init_kb(void) {
  76. #ifdef KEYBOARD_mschwingen_modelm_led_ws2812
  77. ws2812_setleds(led, RGBLED_NUM);
  78. #else
  79. /* Set status LEDs pins to output and Low (on) */
  80. setPinOutput(MODELM_LED_CAPSLOCK);
  81. setPinOutput(MODELM_LED_SCROLLOCK);
  82. setPinOutput(MODELM_LED_NUMLOCK);
  83. writePinLow(MODELM_LED_CAPSLOCK);
  84. writePinLow(MODELM_LED_SCROLLOCK);
  85. writePinLow(MODELM_LED_NUMLOCK);
  86. #endif
  87. setPinOutput(QMK_LED);
  88. writePinHigh(QMK_LED);
  89. _delay_ms(50);
  90. #ifdef UART_DEBUG
  91. uart_init(115200);
  92. print_set_sendchar(capture_sendchar);
  93. uprintf("\r\nHello world!\r\n");
  94. #endif
  95. setPinOutput(SR_LOAD_PIN);
  96. setPinOutput(SR_CLK_PIN);
  97. setPinOutput(SR_DOUT_PIN); // MOSI - unused
  98. writePinLow(SR_CLK_PIN);
  99. }
  100. #ifdef KEYBOARD_mschwingen_modelm_led_ws2812
  101. static void led_update_rgb(void) {
  102. if (isRecording && blink_state) {
  103. led[0] = white;
  104. } else {
  105. switch (default_layer) {
  106. case 0:
  107. led[0] = led_state.num_lock ? blue : lblue;
  108. break;
  109. case 1:
  110. led[0] = led_state.num_lock ? green : black;
  111. break;
  112. }
  113. }
  114. led[1] = led_state.caps_lock ? green : black;
  115. switch (layer) {
  116. case 0:
  117. case 1:
  118. default:
  119. led[2] = led_state.scroll_lock ? green : black;
  120. break;
  121. case 2:
  122. led[2] = led_state.scroll_lock ? red : lred;
  123. break;
  124. case 3:
  125. led[2] = led_state.scroll_lock ? turq : lturq;
  126. break;
  127. }
  128. if (!suspend_active) {
  129. ws2812_setleds(led, RGBLED_NUM);
  130. }
  131. }
  132. bool led_update_kb(led_t state) {
  133. dprintf("LED Update: %d %d %d", led_state.num_lock, led_state.caps_lock, led_state.scroll_lock);
  134. led_state = state;
  135. led_update_rgb();
  136. return true;
  137. }
  138. void update_layer_leds(void) {
  139. static uint8_t old_layer = 255;
  140. static uint8_t old_default_layer = 255;
  141. layer = biton32(layer_state);
  142. default_layer = biton32(default_layer_state);
  143. if (isRecording && timer_elapsed(blink_cycle_timer) > 150) {
  144. blink_state = !blink_state;
  145. blink_cycle_timer = timer_read();
  146. old_layer = 255; // fallthrough next check
  147. }
  148. if (layer == old_layer && default_layer == old_default_layer) {
  149. return;
  150. }
  151. old_layer = layer;
  152. old_default_layer = default_layer;
  153. dprintf("Layer change: %d %d", default_layer, layer);
  154. led_update_rgb();
  155. }
  156. /*****************************************************************************/
  157. #else // classic LEDs on GPIO
  158. bool led_update_kb(led_t led_state) {
  159. dprintf("LED Update: %d %d %d", led_state.num_lock, led_state.caps_lock, led_state.scroll_lock);
  160. if (led_update_user(led_state)) {
  161. if (!isRecording) writePin(MODELM_LED_NUMLOCK, !led_state.num_lock);
  162. writePin(MODELM_LED_CAPSLOCK, !led_state.caps_lock);
  163. writePin(MODELM_LED_SCROLLOCK, !led_state.scroll_lock);
  164. }
  165. return true;
  166. }
  167. void update_layer_leds(void) {
  168. if (isRecording && timer_elapsed(blink_cycle_timer) > 150) {
  169. blink_state = !blink_state;
  170. blink_cycle_timer = timer_read();
  171. writePin(MODELM_LED_NUMLOCK, blink_state);
  172. }
  173. }
  174. #endif
  175. void dynamic_macro_record_start_user(void) {
  176. isRecording++;
  177. blink_cycle_timer = timer_read();
  178. }
  179. void dynamic_macro_record_end_user(int8_t direction) {
  180. if (isRecording) isRecording--;
  181. }