From b69b8c00e31ca2b47d7910709fa7ca0a6aefc914 Mon Sep 17 00:00:00 2001 From: VeyPatch <126267034+VeyPatch@users.noreply.github.com> Date: Tue, 24 Dec 2024 13:31:24 +0100 Subject: [PATCH] Better makefile formatting --- users/halcyon_modules/config.h | 19 +++++----------- .../hlc_cirque_trackpad/config.h | 1 + .../hlc_cirque_trackpad/rules.mk | 4 +--- users/halcyon_modules/hlc_encoder/config.h | 2 ++ users/halcyon_modules/hlc_encoder/rules.mk | 6 ++--- .../halcyon_modules/hlc_tft_display/config.h | 1 + .../halcyon_modules/hlc_tft_display/rules.mk | 22 ++++++++++++++----- users/halcyon_modules/rules.mk | 10 +++------ 8 files changed, 31 insertions(+), 34 deletions(-) diff --git a/users/halcyon_modules/config.h b/users/halcyon_modules/config.h index 40348a97..96f3279c 100644 --- a/users/halcyon_modules/config.h +++ b/users/halcyon_modules/config.h @@ -21,28 +21,19 @@ #define BACKLIGHT_LEVELS 10 #define BACKLIGHT_PWM_CHANNEL RP2040_PWM_CHANNEL_B -#if !defined(HLC_TFT_DISPLAY) - #define BACKLIGHT_PIN GP2 //NOT CONNECTED -#endif - -#if !defined(HLC_CIRQUE_TRACKPAD) - #define POINTING_DEVICE_CS_PIN GP2 //NOT CONNECTED -#endif - #include_next //// Keyboard redefines // Always the same +#define BACKLIGHT_PIN GP2 //NOT CONNECTED +#define POINTING_DEVICE_CS_PIN GP2 //NOT CONNECTED +#define HLC_ENCODER_A NO_PIN +#define HLC_ENCODER_B NO_PIN + #define SPLIT_MODS_ENABLE #define SPLIT_LED_STATE_ENABLE #define SPLIT_LAYER_STATE_ENABLE -#ifndef HLC_ENCODER_A -# define HLC_ENCODER_A NO_PIN -#endif -#ifndef HLC_ENCODER_B -# define HLC_ENCODER_B NO_PIN -#endif // Kyria #if PRODUCT_ID == 0x7FCE diff --git a/users/halcyon_modules/hlc_cirque_trackpad/config.h b/users/halcyon_modules/hlc_cirque_trackpad/config.h index e93ae55e..0377ba12 100644 --- a/users/halcyon_modules/hlc_cirque_trackpad/config.h +++ b/users/halcyon_modules/hlc_cirque_trackpad/config.h @@ -8,6 +8,7 @@ #define HLC_CIRQUE_TRACKPAD #define CIRQUE_PINNACLE_DIAMETER_MM 35 +#undef POINTING_DEVICE_CS_PIN #define POINTING_DEVICE_CS_PIN GP13 #define POINTING_DEVICE_ROTATION_180 #define CIRQUE_PINNACLE_CURVED_OVERLAY diff --git a/users/halcyon_modules/hlc_cirque_trackpad/rules.mk b/users/halcyon_modules/hlc_cirque_trackpad/rules.mk index a4983b87..01da3112 100644 --- a/users/halcyon_modules/hlc_cirque_trackpad/rules.mk +++ b/users/halcyon_modules/hlc_cirque_trackpad/rules.mk @@ -1,3 +1 @@ -CURRENT_DIR := $(dir $(realpath $(lastword $(MAKEFILE_LIST)))) - -CONFIG_H += $(CURRENT_DIR)/config.h +POST_CONFIG_H += $(USER_PATH)/hlc_cirque_trackpad/config.h diff --git a/users/halcyon_modules/hlc_encoder/config.h b/users/halcyon_modules/hlc_encoder/config.h index 0eed0c0f..0c52cebf 100644 --- a/users/halcyon_modules/hlc_encoder/config.h +++ b/users/halcyon_modules/hlc_encoder/config.h @@ -8,5 +8,7 @@ #define HLC_ENCODER #define HLC_ENCODER_BUTTON GP16 +#undef HLC_ENCODER_A #define HLC_ENCODER_A GP27 +#undef HLC_ENCODER_B #define HLC_ENCODER_B GP26 diff --git a/users/halcyon_modules/hlc_encoder/rules.mk b/users/halcyon_modules/hlc_encoder/rules.mk index 0db09e4c..55ae7108 100644 --- a/users/halcyon_modules/hlc_encoder/rules.mk +++ b/users/halcyon_modules/hlc_encoder/rules.mk @@ -1,4 +1,2 @@ -CURRENT_DIR := $(dir $(realpath $(lastword $(MAKEFILE_LIST)))) - -SRC += $(CURRENT_DIR)/hlc_encoder.c -CONFIG_H += $(CURRENT_DIR)/config.h +SRC += $(USER_PATH)/hlc_encoder/hlc_encoder.c +POST_CONFIG_H += $(USER_PATH)/hlc_encoder/config.h diff --git a/users/halcyon_modules/hlc_tft_display/config.h b/users/halcyon_modules/hlc_tft_display/config.h index 7bbd949a..13b3930f 100644 --- a/users/halcyon_modules/hlc_tft_display/config.h +++ b/users/halcyon_modules/hlc_tft_display/config.h @@ -28,6 +28,7 @@ #define SURFACE_NUM_DEVICES 1 // Backlight configuration +#undef BACKLIGHT_PIN #define BACKLIGHT_PIN GP27 // Timeout configuration diff --git a/users/halcyon_modules/hlc_tft_display/rules.mk b/users/halcyon_modules/hlc_tft_display/rules.mk index 34319ae9..56b5e97c 100644 --- a/users/halcyon_modules/hlc_tft_display/rules.mk +++ b/users/halcyon_modules/hlc_tft_display/rules.mk @@ -1,9 +1,19 @@ -CURRENT_DIR := $(dir $(realpath $(lastword $(MAKEFILE_LIST)))) - -SRC += $(CURRENT_DIR)/hlc_tft_display.c -CONFIG_H += $(CURRENT_DIR)/config.h +SRC += $(USER_PATH)/hlc_tft_display/hlc_tft_display.c +POST_CONFIG_H += $(USER_PATH)/hlc_tft_display/config.h # Fonts -SRC += $(CURRENT_DIR)/graphics/fonts/Retron2000-27.qff.c $(CURRENT_DIR)/graphics/fonts/Retron2000-underline-27.qff.c +SRC += $(USER_PATH)/hlc_tft_display/graphics/fonts/Retron2000-27.qff.c \ + $(USER_PATH)/hlc_tft_display/graphics/fonts/Retron2000-underline-27.qff.c + # Numbers in image format -SRC += $(CURRENT_DIR)/graphics/numbers/0.qgf.c $(CURRENT_DIR)/graphics/numbers/1.qgf.c $(CURRENT_DIR)/graphics/numbers/2.qgf.c $(CURRENT_DIR)/graphics/numbers/3.qgf.c $(CURRENT_DIR)/graphics/numbers/4.qgf.c $(CURRENT_DIR)/graphics/numbers/5.qgf.c $(CURRENT_DIR)/graphics/numbers/6.qgf.c $(CURRENT_DIR)/graphics/numbers/7.qgf.c $(CURRENT_DIR)/graphics/numbers/8.qgf.c $(CURRENT_DIR)/graphics/numbers/9.qgf.c $(CURRENT_DIR)/graphics/numbers/undef.qgf.c +SRC += $(USER_PATH)/hlc_tft_display/graphics/numbers/0.qgf.c \ + $(USER_PATH)/hlc_tft_display/graphics/numbers/1.qgf.c \ + $(USER_PATH)/hlc_tft_display/graphics/numbers/2.qgf.c \ + $(USER_PATH)/hlc_tft_display/graphics/numbers/3.qgf.c \ + $(USER_PATH)/hlc_tft_display/graphics/numbers/4.qgf.c \ + $(USER_PATH)/hlc_tft_display/graphics/numbers/5.qgf.c \ + $(USER_PATH)/hlc_tft_display/graphics/numbers/6.qgf.c \ + $(USER_PATH)/hlc_tft_display/graphics/numbers/7.qgf.c \ + $(USER_PATH)/hlc_tft_display/graphics/numbers/8.qgf.c \ + $(USER_PATH)/hlc_tft_display/graphics/numbers/9.qgf.c \ + $(USER_PATH)/hlc_tft_display/graphics/numbers/undef.qgf.c diff --git a/users/halcyon_modules/rules.mk b/users/halcyon_modules/rules.mk index 8a6cea7b..f2c356dc 100644 --- a/users/halcyon_modules/rules.mk +++ b/users/halcyon_modules/rules.mk @@ -1,7 +1,3 @@ -CURRENT_DIR := $(dir $(realpath $(lastword $(MAKEFILE_LIST)))) - -ERR_COLOR = $(strip $(call make_std_color,1)) - SRC += halcyon.c # May need to be changed when adding more pointing devices @@ -16,15 +12,15 @@ BACKLIGHT_ENABLE = yes BACKLIGHT_DRIVER = pwm ifdef HLC_ENCODER - include $(CURRENT_DIR)/hlc_encoder/rules.mk + include $(USER_PATH)/hlc_encoder/rules.mk endif ifdef HLC_TFT_DISPLAY - include $(CURRENT_DIR)/hlc_tft_display/rules.mk + include $(USER_PATH)/hlc_tft_display/rules.mk endif ifdef HLC_CIRQUE_TRACKPAD - include $(CURRENT_DIR)/hlc_cirque_trackpad/rules.mk + include $(USER_PATH)/hlc_cirque_trackpad/rules.mk endif HLC_OPTIONS := $(HLC_NONE) $(HLC_CIRQUE_TRACKPAD) $(HLC_ENCODER) $(HLC_TFT_DISPLAY)