matrix_output_unselect_delay_ondemand.c 480 B

123456789101112131415161718
  1. // Copyright (c) 2021 Takeshi Ishii (mtei@github)
  2. // SPDX-License-Identifier: GPL-2.0-or-later
  3. #include QMK_KEYBOARD_H
  4. void matrix_output_unselect_delay(uint8_t line, bool key_pressed) {
  5. /* If none of the keys are pressed,
  6. * there is no need to wait for time for the next line. */
  7. if (key_pressed) {
  8. # ifdef MATRIX_IO_DELAY
  9. # if MATRIX_IO_DELAY > 0
  10. wait_us(MATRIX_IO_DELAY);
  11. # endif
  12. # else
  13. wait_us(30);
  14. # endif
  15. }
  16. }