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.

213 lines
6.2 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
[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
[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 "mschwingen.h"
  18. #include "uart.h"
  19. #include "print.h"
  20. #include "sendchar.h"
  21. #include "ws2812.h"
  22. #include "sleep_led.h"
  23. #ifdef UART_DEBUG
  24. # undef sendchar
  25. static int8_t capture_sendchar(uint8_t c) {
  26. // sendchar(c);
  27. uart_write(c);
  28. return 0;
  29. }
  30. #endif
  31. static uint16_t blink_cycle_timer;
  32. static bool blink_state = false;
  33. static uint8_t isRecording = 0;
  34. #ifdef KEYBOARD_ibm_model_m_mschwingen_led_ws2812
  35. # if RGBLED_NUM < 3
  36. # error we need at least 3 RGB LEDs!
  37. # endif
  38. static cRGB led[RGBLED_NUM] = {{255, 255, 255}, {255, 255, 255}, {255, 255, 255}};
  39. # define BRIGHT 32
  40. # define DIM 6
  41. static const cRGB black = {.r = 0, .g = 0, .b = 0};
  42. static const __attribute__((unused)) cRGB green = {.r = 0, .g = BRIGHT, .b = 0};
  43. static const __attribute__((unused)) cRGB lgreen = {.r = 0, .g = DIM, .b = 0};
  44. static const __attribute__((unused)) cRGB red = {.r = BRIGHT, .g = 0, .b = 0};
  45. static const __attribute__((unused)) cRGB lred = {.r = DIM, .g = 0, .b = 0};
  46. static const __attribute__((unused)) cRGB blue = {.r = 0, .g = 0, .b = BRIGHT};
  47. static const __attribute__((unused)) cRGB lblue = {.r = 0, .g = 0, .b = DIM};
  48. static const __attribute__((unused)) cRGB turq = {.r = 0, .g = BRIGHT, .b = BRIGHT};
  49. static const __attribute__((unused)) cRGB lturq = {.r = 0, .g = DIM, .b = DIM};
  50. static const __attribute__((unused)) cRGB white = {.r = BRIGHT, .g = BRIGHT, .b = BRIGHT};
  51. static led_t led_state;
  52. static uint8_t layer;
  53. static uint8_t default_layer;
  54. #endif
  55. // we need our own sleep_led_* implementation to get callbacks on USB
  56. // suspend/resume in order to completely turn off WS2812 LEDs
  57. static bool suspend_active = false;
  58. void sleep_led_init(void) {}
  59. void sleep_led_toggle(void) {}
  60. void sleep_led_disable(void) {
  61. suspend_active = false;
  62. writePinHigh(MODELM_STATUS_LED);
  63. }
  64. void sleep_led_enable(void) {
  65. suspend_active = true;
  66. writePinLow(MODELM_STATUS_LED);
  67. #ifdef KEYBOARD_ibm_model_m_mschwingen_led_ws2812
  68. led[0] = black;
  69. led[1] = black;
  70. led[2] = black;
  71. ws2812_setleds(led, RGBLED_NUM);
  72. #endif
  73. }
  74. void keyboard_pre_init_kb(void) {
  75. #ifdef KEYBOARD_ibm_model_m_mschwingen_led_ws2812
  76. ws2812_setleds(led, RGBLED_NUM);
  77. #else
  78. /* Set status LEDs pins to output and Low (on) */
  79. setPinOutput(MODELM_LED_CAPSLOCK);
  80. setPinOutput(MODELM_LED_SCROLLOCK);
  81. setPinOutput(MODELM_LED_NUMLOCK);
  82. writePinLow(MODELM_LED_CAPSLOCK);
  83. writePinLow(MODELM_LED_SCROLLOCK);
  84. writePinLow(MODELM_LED_NUMLOCK);
  85. #endif
  86. setPinOutput(MODELM_STATUS_LED);
  87. writePinHigh(MODELM_STATUS_LED);
  88. _delay_ms(50);
  89. #ifdef UART_DEBUG
  90. uart_init(115200);
  91. print_set_sendchar(capture_sendchar);
  92. uprintf("\r\nHello world!\r\n");
  93. #endif
  94. setPinOutput(SR_LOAD_PIN);
  95. setPinOutput(SR_CLK_PIN);
  96. setPinOutput(SR_DOUT_PIN); // MOSI - unused
  97. writePinLow(SR_CLK_PIN);
  98. }
  99. #ifdef KEYBOARD_ibm_model_m_mschwingen_led_ws2812
  100. static void led_update_rgb(void) {
  101. if (isRecording && blink_state) {
  102. led[0] = white;
  103. } else {
  104. switch (default_layer) {
  105. case 0:
  106. led[0] = led_state.num_lock ? blue : lblue;
  107. break;
  108. case 1:
  109. led[0] = led_state.num_lock ? green : black;
  110. break;
  111. }
  112. }
  113. led[1] = led_state.caps_lock ? green : black;
  114. switch (layer) {
  115. case 0:
  116. case 1:
  117. default:
  118. led[2] = led_state.scroll_lock ? green : black;
  119. break;
  120. case 2:
  121. led[2] = led_state.scroll_lock ? red : lred;
  122. break;
  123. case 3:
  124. led[2] = led_state.scroll_lock ? turq : lturq;
  125. break;
  126. }
  127. if (!suspend_active) {
  128. ws2812_setleds(led, RGBLED_NUM);
  129. }
  130. }
  131. bool led_update_kb(led_t state) {
  132. dprintf("LED Update: %d %d %d", led_state.num_lock, led_state.caps_lock, led_state.scroll_lock);
  133. led_state = state;
  134. led_update_rgb();
  135. return true;
  136. }
  137. void update_layer_leds(void) {
  138. static uint8_t old_layer = 255;
  139. static uint8_t old_default_layer = 255;
  140. layer = get_highest_layer(layer_state);
  141. default_layer = get_highest_layer(default_layer_state);
  142. if (isRecording && timer_elapsed(blink_cycle_timer) > 150) {
  143. blink_state = !blink_state;
  144. blink_cycle_timer = timer_read();
  145. old_layer = 255; // fallthrough next check
  146. }
  147. if (layer == old_layer && default_layer == old_default_layer) {
  148. return;
  149. }
  150. old_layer = layer;
  151. old_default_layer = default_layer;
  152. dprintf("Layer change: %d %d", default_layer, layer);
  153. led_update_rgb();
  154. }
  155. /*****************************************************************************/
  156. #else // classic LEDs on GPIO
  157. bool led_update_kb(led_t led_state) {
  158. dprintf("LED Update: %d %d %d", led_state.num_lock, led_state.caps_lock, led_state.scroll_lock);
  159. if (led_update_user(led_state)) {
  160. if (!isRecording) writePin(MODELM_LED_NUMLOCK, !led_state.num_lock);
  161. writePin(MODELM_LED_CAPSLOCK, !led_state.caps_lock);
  162. writePin(MODELM_LED_SCROLLOCK, !led_state.scroll_lock);
  163. }
  164. return true;
  165. }
  166. void update_layer_leds(void) {
  167. if (isRecording && timer_elapsed(blink_cycle_timer) > 150) {
  168. blink_state = !blink_state;
  169. blink_cycle_timer = timer_read();
  170. writePin(MODELM_LED_NUMLOCK, blink_state);
  171. }
  172. }
  173. #endif
  174. void dynamic_macro_record_start_user(int8_t direction) {
  175. isRecording++;
  176. blink_cycle_timer = timer_read();
  177. }
  178. void dynamic_macro_record_end_user(int8_t direction) {
  179. if (isRecording) isRecording--;
  180. }