From b5b6a8d3a3eef7bd7fda1b7945c116a1c875a5ef Mon Sep 17 00:00:00 2001 From: Drashna Jael're Date: Sat, 4 Sep 2021 13:21:15 -0700 Subject: [PATCH 1/2] Move Audio drivers from quantum to platform drivers folder --- common_features.mk | 2 +- .../avr/drivers/audio_pwm.h | 0 .../avr/drivers/audio_pwm_hardware.c | 0 .../chibios/drivers/audio_dac.h | 0 .../chibios/drivers/audio_dac_additive.c | 0 .../chibios/drivers/audio_dac_basic.c | 0 .../chibios/drivers/audio_pwm.h | 0 .../chibios/drivers/audio_pwm_hardware.c | 0 .../chibios/drivers/audio_pwm_software.c | 0 quantum/audio/audio.h | 13 ++++--------- 10 files changed, 5 insertions(+), 10 deletions(-) rename quantum/audio/driver_avr_pwm.h => platforms/avr/drivers/audio_pwm.h (100%) rename quantum/audio/driver_avr_pwm_hardware.c => platforms/avr/drivers/audio_pwm_hardware.c (100%) rename quantum/audio/driver_chibios_dac.h => platforms/chibios/drivers/audio_dac.h (100%) rename quantum/audio/driver_chibios_dac_additive.c => platforms/chibios/drivers/audio_dac_additive.c (100%) rename quantum/audio/driver_chibios_dac_basic.c => platforms/chibios/drivers/audio_dac_basic.c (100%) rename quantum/audio/driver_chibios_pwm.h => platforms/chibios/drivers/audio_pwm.h (100%) rename quantum/audio/driver_chibios_pwm_hardware.c => platforms/chibios/drivers/audio_pwm_hardware.c (100%) rename quantum/audio/driver_chibios_pwm_software.c => platforms/chibios/drivers/audio_pwm_software.c (100%) diff --git a/common_features.mk b/common_features.mk index 8b5ee071d774..54c4e85a9820 100644 --- a/common_features.mk +++ b/common_features.mk @@ -82,7 +82,7 @@ ifeq ($(strip $(AUDIO_ENABLE)), yes) SRC += $(QUANTUM_DIR)/process_keycode/process_audio.c SRC += $(QUANTUM_DIR)/process_keycode/process_clicky.c SRC += $(QUANTUM_DIR)/audio/audio.c ## common audio code, hardware agnostic - SRC += $(QUANTUM_DIR)/audio/driver_$(PLATFORM_KEY)_$(strip $(AUDIO_DRIVER)).c + SRC += audio_$(strip $(AUDIO_DRIVER)).c SRC += $(QUANTUM_DIR)/audio/voices.c SRC += $(QUANTUM_DIR)/audio/luts.c endif diff --git a/quantum/audio/driver_avr_pwm.h b/platforms/avr/drivers/audio_pwm.h similarity index 100% rename from quantum/audio/driver_avr_pwm.h rename to platforms/avr/drivers/audio_pwm.h diff --git a/quantum/audio/driver_avr_pwm_hardware.c b/platforms/avr/drivers/audio_pwm_hardware.c similarity index 100% rename from quantum/audio/driver_avr_pwm_hardware.c rename to platforms/avr/drivers/audio_pwm_hardware.c diff --git a/quantum/audio/driver_chibios_dac.h b/platforms/chibios/drivers/audio_dac.h similarity index 100% rename from quantum/audio/driver_chibios_dac.h rename to platforms/chibios/drivers/audio_dac.h diff --git a/quantum/audio/driver_chibios_dac_additive.c b/platforms/chibios/drivers/audio_dac_additive.c similarity index 100% rename from quantum/audio/driver_chibios_dac_additive.c rename to platforms/chibios/drivers/audio_dac_additive.c diff --git a/quantum/audio/driver_chibios_dac_basic.c b/platforms/chibios/drivers/audio_dac_basic.c similarity index 100% rename from quantum/audio/driver_chibios_dac_basic.c rename to platforms/chibios/drivers/audio_dac_basic.c diff --git a/quantum/audio/driver_chibios_pwm.h b/platforms/chibios/drivers/audio_pwm.h similarity index 100% rename from quantum/audio/driver_chibios_pwm.h rename to platforms/chibios/drivers/audio_pwm.h diff --git a/quantum/audio/driver_chibios_pwm_hardware.c b/platforms/chibios/drivers/audio_pwm_hardware.c similarity index 100% rename from quantum/audio/driver_chibios_pwm_hardware.c rename to platforms/chibios/drivers/audio_pwm_hardware.c diff --git a/quantum/audio/driver_chibios_pwm_software.c b/platforms/chibios/drivers/audio_pwm_software.c similarity index 100% rename from quantum/audio/driver_chibios_pwm_software.c rename to platforms/chibios/drivers/audio_pwm_software.c diff --git a/quantum/audio/audio.h b/quantum/audio/audio.h index 56b9158a1a03..290d461f5a16 100644 --- a/quantum/audio/audio.h +++ b/quantum/audio/audio.h @@ -26,17 +26,12 @@ #if defined(__AVR__) # include -# if defined(AUDIO_DRIVER_PWM) -# include "driver_avr_pwm.h" -# endif #endif -#if defined(PROTOCOL_CHIBIOS) -# if defined(AUDIO_DRIVER_PWM) -# include "driver_chibios_pwm.h" -# elif defined(AUDIO_DRIVER_DAC) -# include "driver_chibios_dac.h" -# endif +#if defined(AUDIO_DRIVER_PWM) +# include "audio_pwm.h" +#elif defined(AUDIO_DRIVER_DAC) +# include "audio_dac.h" #endif typedef union { From 4064473c9f89dc2ee85266336002ddaf3e5e4505 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Fri, 24 Sep 2021 14:16:13 -0700 Subject: [PATCH 2/2] fix path for audio drivers Co-authored-by: Ryan --- common_features.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common_features.mk b/common_features.mk index 54c4e85a9820..98cf129d8521 100644 --- a/common_features.mk +++ b/common_features.mk @@ -82,7 +82,7 @@ ifeq ($(strip $(AUDIO_ENABLE)), yes) SRC += $(QUANTUM_DIR)/process_keycode/process_audio.c SRC += $(QUANTUM_DIR)/process_keycode/process_clicky.c SRC += $(QUANTUM_DIR)/audio/audio.c ## common audio code, hardware agnostic - SRC += audio_$(strip $(AUDIO_DRIVER)).c + SRC += $(PLATFORM_PATH)/$(PLATFORM_KEY)/$(DRIVER_DIR)/audio_$(strip $(AUDIO_DRIVER)).c SRC += $(QUANTUM_DIR)/audio/voices.c SRC += $(QUANTUM_DIR)/audio/luts.c endif