diff --git a/firmware/CMakePresets.json b/firmware/CMakePresets.json index 94b84578d..4318ab9c6 100644 --- a/firmware/CMakePresets.json +++ b/firmware/CMakePresets.json @@ -32,6 +32,14 @@ "value": "ON" } } + }, + { + "name": "pcb-p12", + "description": "PCB p11 with mods (aka p12)", + "inherits": "base", + "cacheVariables": { + "METAMODULE_PCB_VERSION": "12" + } } ], "buildPresets": [ @@ -40,4 +48,4 @@ "configurePreset": "base" } ] -} \ No newline at end of file +} diff --git a/firmware/Makefile b/firmware/Makefile index 4a8df9eb9..60c5b11ae 100644 --- a/firmware/Makefile +++ b/firmware/Makefile @@ -1,4 +1,4 @@ -PRESET := base +PRESET ?= base # Detect MinGW and use Make ifdef SYSTEMROOT diff --git a/firmware/src/CMakeLists.txt b/firmware/src/CMakeLists.txt index a701b016d..c7d5d46cf 100644 --- a/firmware/src/CMakeLists.txt +++ b/firmware/src/CMakeLists.txt @@ -306,6 +306,10 @@ foreach(brand ${brands}) target_link_libraries(main.elf PRIVATE ${brand}Library) endforeach() +if (METAMODULE_PCB_VERSION) + target_compile_definitions(main.elf PRIVATE METAMODULE_PCB_VERSION=${METAMODULE_PCB_VERSION}) +endif() + add_dependencies(main.elf m4_firmware) target_link_script( diff --git a/firmware/src/audio/audio.cc b/firmware/src/audio/audio.cc index 79beb3801..0eaa26ddf 100644 --- a/firmware/src/audio/audio.cc +++ b/firmware/src/audio/audio.cc @@ -117,7 +117,7 @@ void AudioStream::start() { AudioConf::SampleT AudioStream::get_audio_output(int output_id) { auto raw_out = player.get_panel_output(output_id) * mute_ctr; - raw_out = -raw_out / OutputHighRangeVolts; + raw_out = -raw_out / OutputMaxVolts; auto scaled_out = AudioOutFrame::scaleOutput(raw_out); return scaled_out; } diff --git a/firmware/src/medium/conf/scaling_config.hh b/firmware/src/medium/conf/scaling_config.hh index 054f69d33..7970167b7 100644 --- a/firmware/src/medium/conf/scaling_config.hh +++ b/firmware/src/medium/conf/scaling_config.hh @@ -8,7 +8,8 @@ static inline constexpr int32_t InputHighRangeMillivolts = 10310; static inline constexpr float InputRangeVolts = InputHighRangeVolts - InputLowRangeVolts; static inline constexpr float InputRangeCenterVolts = (InputHighRangeVolts + InputLowRangeVolts) / 2.f; -static inline constexpr float OutputLowRangeVolts = -8.59f; -static inline constexpr float OutputHighRangeVolts = 8.59f; -static inline constexpr float OutputRangeVolts = OutputHighRangeVolts - OutputLowRangeVolts; -static inline constexpr float OutputRangeCenterVolts = (OutputHighRangeVolts + OutputLowRangeVolts) / 2.f; +#if defined(METAMODULE_PCB_VERSION) && (METAMODULE_PCB_VERSION == 12) +static inline constexpr float OutputMaxVolts = 10.4f; +#else +static inline constexpr float OutputMaxVolts = 8.59f; +#endif