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

This commit is contained in:
QMK Bot 2024-03-01 21:45:21 +00:00
commit 7fd0201a92
2 changed files with 13 additions and 7 deletions

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