From 987f778a25c16d5bf62afd830df878e7563e33f5 Mon Sep 17 00:00:00 2001 From: Dreaded_X Date: Sat, 1 Apr 2023 04:10:57 +0200 Subject: [PATCH] Added menuconfig option to switch between prototype and eventual production hardware --- software/main/Kconfig.projbuild | 7 +++++++ software/main/include/config.h | 25 +++++++++++++++---------- software/sdkconfig | 6 ++++++ 3 files changed, 28 insertions(+), 10 deletions(-) create mode 100644 software/main/Kconfig.projbuild diff --git a/software/main/Kconfig.projbuild b/software/main/Kconfig.projbuild new file mode 100644 index 0000000..89c995e --- /dev/null +++ b/software/main/Kconfig.projbuild @@ -0,0 +1,7 @@ +menu "Car Stereo Configuration" + config CAR_STEREO_PROTOTYPE + bool "Prototype" + default false + help + Compile the code for the car stereo prototype instead of the final design +endmenu diff --git a/software/main/include/config.h b/software/main/include/config.h index 09089cf..20adb8a 100644 --- a/software/main/include/config.h +++ b/software/main/include/config.h @@ -3,14 +3,19 @@ #include "hal/gpio_types.h" // FOR PROTOTYPE -/* #define I2S_PIN_BCK GPIO_NUM_26 */ -/* #define I2S_PIN_WS GPIO_NUM_25 */ -/* #define I2S_PIN_DATA GPIO_NUM_33 */ -/* #define TWAI_PIN_CTX GPIO_NUM_5 */ -/* #define TWAI_PIN_CRX GPIO_NUM_19 */ +#ifdef CONFIG_CAR_STEREO_PROTOTYPE + #pragma message ( "Building for the prototype" ) + #define I2S_PIN_BCK GPIO_NUM_26 + #define I2S_PIN_WS GPIO_NUM_25 + #define I2S_PIN_DATA GPIO_NUM_33 + #define TWAI_PIN_CTX GPIO_NUM_5 + #define TWAI_PIN_CRX GPIO_NUM_19 +#else + #pragma message ( "Building for the production" ) + #define I2S_PIN_BCK GPIO_NUM_5 + #define I2S_PIN_WS GPIO_NUM_16 + #define I2S_PIN_DATA GPIO_NUM_17 + #define TWAI_PIN_CTX GPIO_NUM_32 + #define TWAI_PIN_CRX GPIO_NUM_35 +#endif -#define I2S_PIN_BCK GPIO_NUM_5 -#define I2S_PIN_WS GPIO_NUM_16 -#define I2S_PIN_DATA GPIO_NUM_17 -#define TWAI_PIN_CTX GPIO_NUM_32 -#define TWAI_PIN_CRX GPIO_NUM_35 diff --git a/software/sdkconfig b/software/sdkconfig index 4941797..1c2d1c8 100644 --- a/software/sdkconfig +++ b/software/sdkconfig @@ -283,6 +283,12 @@ CONFIG_PARTITION_TABLE_OFFSET=0x8000 CONFIG_PARTITION_TABLE_MD5=y # end of Partition Table +# +# Car Stereo Configuration +# +# CONFIG_CAR_STEREO_PROTOTYPE is not set +# end of Car Stereo Configuration + # # Compiler options #