Merge remote-tracking branch 'origin/develop' into xap

This commit is contained in:
QMK Bot 2024-03-01 21:45:49 +00:00
commit a9927e0b9b
3 changed files with 22 additions and 8 deletions

View File

@ -1,7 +1,8 @@
// Copyright 2018-2022 Nick Brassel (@tzarc)
// SPDX-License-Identifier: GPL-2.0-or-later
#include <ch.h>
#include <hal.h>
#include "quantum.h"
#include <hal_pal.h>
#include "djinn.h"
#define GPIOB_BITMASK (1 << 13 | 1 << 14 | 1 << 15) // B13, B14, B15
@ -34,6 +35,8 @@ void matrix_wait_for_port(stm32_gpio_t *port, uint32_t target_bitmask) {
}
}
static void dummy_vt_callback(virtual_timer_t *vtp, void *p) {}
void matrix_init_custom(void) {
for (int i = 0; i < MATRIX_ROWS; ++i) {
setPinInputHigh(row_pins[i]);
@ -41,6 +44,11 @@ void matrix_init_custom(void) {
for (int i = 0; i < MATRIX_COLS; ++i) {
setPinInputHigh(col_pins[i]);
}
// Start a virtual timer so we'll still get periodic wakeups, now that USB SOF doesn't wake up the main loop
static virtual_timer_t vt;
chVTObjectInit(&vt);
chVTSetContinuous(&vt, TIME_MS2I(10), dummy_vt_callback, NULL);
}
bool matrix_scan_custom(matrix_row_t current_matrix[]) {

View File

@ -7,6 +7,7 @@ from collections.abc import Mapping
from functools import lru_cache
from typing import OrderedDict
from pathlib import Path
from copy import deepcopy
from milc import cli
@ -22,7 +23,8 @@ def _dict_raise_on_duplicates(ordered_pairs):
return d
def json_load(json_file, strict=True):
@lru_cache(maxsize=20)
def _json_load_impl(json_file, strict=True):
"""Load a json file from disk.
Note: file must be a Path object.
@ -42,7 +44,11 @@ def json_load(json_file, strict=True):
exit(1)
@lru_cache(maxsize=0)
def json_load(json_file, strict=True):
return deepcopy(_json_load_impl(json_file=json_file, strict=strict))
@lru_cache(maxsize=20)
def load_jsonschema(schema_name):
"""Read a jsonschema file from disk.
"""
@ -57,7 +63,7 @@ def load_jsonschema(schema_name):
return json_load(schema_path)
@lru_cache(maxsize=0)
@lru_cache(maxsize=1)
def compile_schema_store():
"""Compile all our schemas into a schema store.
"""
@ -73,7 +79,7 @@ def compile_schema_store():
return schema_store
@lru_cache(maxsize=0)
@lru_cache(maxsize=20)
def create_validator(schema):
"""Creates a validator for the given schema id.
"""

View File

@ -201,17 +201,17 @@ else ifeq ($(strip $(BOOTLOADER)), qmk-hid)
QMK_BOOTLOADER_TYPE = HID
endif
bootloader:
bootloader: cpfirmware
ifeq ($(strip $(QMK_BOOTLOADER_TYPE)),)
$(call CATASTROPHIC_ERROR,Invalid BOOTLOADER,Please set BOOTLOADER to "qmk-dfu" or "qmk-hid" first!)
else
make -C lib/lufa/Bootloaders/$(QMK_BOOTLOADER_TYPE)/ clean
make -C lib/lufa/Bootloaders/$(QMK_BOOTLOADER_TYPE)/ clean TARGET=Bootloader$(QMK_BOOTLOADER_TYPE)
$(QMK_BIN) generate-dfu-header --quiet --keyboard $(KEYBOARD) --output lib/lufa/Bootloaders/$(QMK_BOOTLOADER_TYPE)/Keyboard.h
$(eval MAX_SIZE=$(shell n=`$(CC) -E -mmcu=$(MCU) -D__ASSEMBLER__ $(CFLAGS) $(OPT_DEFS) platforms/avr/bootloader_size.c 2> /dev/null | sed -ne 's/\r//;/^#/n;/^AVR_SIZE:/,$${s/^AVR_SIZE: //;p;}'` && echo $$(($$n)) || echo 0))
$(eval PROGRAM_SIZE_KB=$(shell n=`expr $(MAX_SIZE) / 1024` && echo $$(($$n)) || echo 0))
$(eval BOOT_SECTION_SIZE_KB=$(shell n=`expr $(BOOTLOADER_SIZE) / 1024` && echo $$(($$n)) || echo 0))
$(eval FLASH_SIZE_KB=$(shell n=`expr $(PROGRAM_SIZE_KB) + $(BOOT_SECTION_SIZE_KB)` && echo $$(($$n)) || echo 0))
make -C lib/lufa/Bootloaders/$(QMK_BOOTLOADER_TYPE)/ MCU=$(MCU) ARCH=$(ARCH) F_CPU=$(F_CPU) FLASH_SIZE_KB=$(FLASH_SIZE_KB) BOOT_SECTION_SIZE_KB=$(BOOT_SECTION_SIZE_KB)
make -C lib/lufa/Bootloaders/$(QMK_BOOTLOADER_TYPE)/ MCU=$(MCU) ARCH=$(ARCH) F_CPU=$(F_CPU) FLASH_SIZE_KB=$(FLASH_SIZE_KB) BOOT_SECTION_SIZE_KB=$(BOOT_SECTION_SIZE_KB) TARGET=Bootloader$(QMK_BOOTLOADER_TYPE)
printf "Bootloader$(QMK_BOOTLOADER_TYPE).hex copied to $(TARGET)_bootloader.hex\n"
cp lib/lufa/Bootloaders/$(QMK_BOOTLOADER_TYPE)/Bootloader$(QMK_BOOTLOADER_TYPE).hex $(TARGET)_bootloader.hex
endif