From b1de11c27575f9956d2f7dfd6bf0240d630e3ae1 Mon Sep 17 00:00:00 2001 From: Takeshi ISHII <2170248+mtei@users.noreply.github.com> Date: Mon, 21 Feb 2022 23:13:06 +0900 Subject: [PATCH 1/2] Fix a potential bug in encoder_init(). (#16372) After executing `setPinInputHigh(pin)`, it is necessary to wait for the charging time to read from the corresponding pin. This is the same as requiring `matrix_output_unselect_delay()` after doing `unselect_row()` in matrix.c. --- quantum/encoder.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/quantum/encoder.c b/quantum/encoder.c index 8fb87281c2b..ecbc0c16153 100644 --- a/quantum/encoder.c +++ b/quantum/encoder.c @@ -59,6 +59,8 @@ static uint8_t thisHand, thatHand; static uint8_t encoder_value[NUMBER_OF_ENCODERS] = {0}; #endif +__attribute__((weak)) void encoder_wait_pullup_charge(void) { wait_us(100); } + __attribute__((weak)) bool encoder_update_user(uint8_t index, bool clockwise) { return true; } __attribute__((weak)) bool encoder_update_kb(uint8_t index, bool clockwise) { return encoder_update_user(index, clockwise); } @@ -84,7 +86,9 @@ void encoder_init(void) { for (int i = 0; i < NUMBER_OF_ENCODERS; i++) { setPinInputHigh(encoders_pad_a[i]); setPinInputHigh(encoders_pad_b[i]); - + } + encoder_wait_pullup_charge(); + for (int i = 0; i < NUMBER_OF_ENCODERS; i++) { encoder_state[i] = (readPin(encoders_pad_a[i]) << 0) | (readPin(encoders_pad_b[i]) << 1); } From f30f963a0b6ccaa151fe83dd8302fa1f6829086e Mon Sep 17 00:00:00 2001 From: Ryan Date: Tue, 22 Feb 2022 02:47:44 +1100 Subject: [PATCH 2/2] Internal docs generation updates (#16411) --- .gitignore | 1 - Doxyfile | 6 +++--- lib/python/qmk/cli/generate/docs.py | 16 ++++++++++------ 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index 768f40b1918..3cc40dc2ad5 100644 --- a/.gitignore +++ b/.gitignore @@ -18,7 +18,6 @@ # QMK-specific api_data/v1 -doxygen/ quantum/version.h *.bin *.eep diff --git a/Doxyfile b/Doxyfile index 218d77b4dda..4b0ea3f086d 100644 --- a/Doxyfile +++ b/Doxyfile @@ -21,7 +21,7 @@ DOXYFILE_ENCODING = UTF-8 PROJECT_NAME = "QMK Firmware" PROJECT_NUMBER = https://github.com/qmk/qmk_firmware PROJECT_BRIEF = "Keyboard controller firmware for Atmel AVR and ARM USB families" -OUTPUT_DIRECTORY = doxygen +OUTPUT_DIRECTORY = .build/doxygen ALLOW_UNICODE_NAMES = NO OUTPUT_LANGUAGE = English BRIEF_MEMBER_DESC = YES @@ -145,7 +145,7 @@ FILE_PATTERNS = *.c \ RECURSIVE = YES EXCLUDE = EXCLUDE_SYMLINKS = NO -EXCLUDE_PATTERNS = +EXCLUDE_PATTERNS = */protocol/arm_atsam/* EXCLUDE_SYMBOLS = EXAMPLE_PATH = EXAMPLE_PATTERNS = * @@ -209,7 +209,7 @@ EXPAND_ONLY_PREDEF = NO SEARCH_INCLUDES = YES INCLUDE_PATH = INCLUDE_FILE_PATTERNS = -PREDEFINED = +PREDEFINED = __DOXYGEN__ PROGMEM EXPAND_AS_DEFINED = SKIP_FUNCTION_MACROS = YES diff --git a/lib/python/qmk/cli/generate/docs.py b/lib/python/qmk/cli/generate/docs.py index 749336fea55..74112d834d1 100644 --- a/lib/python/qmk/cli/generate/docs.py +++ b/lib/python/qmk/cli/generate/docs.py @@ -7,7 +7,9 @@ from subprocess import DEVNULL from milc import cli DOCS_PATH = Path('docs/') -BUILD_PATH = Path('.build/docs/') +BUILD_PATH = Path('.build/') +BUILD_DOCS_PATH = BUILD_PATH / 'docs' +DOXYGEN_PATH = BUILD_PATH / 'doxygen' @cli.subcommand('Build QMK documentation.', hidden=False if cli.config.user.developer else True) @@ -18,10 +20,12 @@ def generate_docs(cli): * [ ] Add a real build step... something static docs """ - if BUILD_PATH.exists(): - shutil.rmtree(BUILD_PATH) + if BUILD_DOCS_PATH.exists(): + shutil.rmtree(BUILD_DOCS_PATH) + if DOXYGEN_PATH.exists(): + shutil.rmtree(DOXYGEN_PATH) - shutil.copytree(DOCS_PATH, BUILD_PATH) + shutil.copytree(DOCS_PATH, BUILD_DOCS_PATH) # When not verbose we want to hide all output args = { @@ -34,6 +38,6 @@ def generate_docs(cli): # Generate internal docs cli.run(['doxygen', 'Doxyfile'], **args) - cli.run(['moxygen', '-q', '-a', '-g', '-o', BUILD_PATH / 'internals_%s.md', 'doxygen/xml'], **args) + cli.run(['moxygen', '-q', '-g', '-o', BUILD_DOCS_PATH / 'internals_%s.md', DOXYGEN_PATH / 'xml'], **args) - cli.log.info('Successfully generated internal docs to %s.', BUILD_PATH) + cli.log.info('Successfully generated internal docs to %s.', BUILD_DOCS_PATH)