From fa00aa0ad45096bd7e546aa45f12b8b22fc878b5 Mon Sep 17 00:00:00 2001 From: Matthew Kennedy Date: Thu, 1 Dec 2022 15:51:01 -0800 Subject: [PATCH] save ram --- firmware/pump_dac.cpp | 2 +- firmware/pwm.cpp | 2 +- firmware/pwm.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/firmware/pump_dac.cpp b/firmware/pump_dac.cpp index 69d37cb..5bc3827 100644 --- a/firmware/pump_dac.cpp +++ b/firmware/pump_dac.cpp @@ -7,7 +7,7 @@ #include "hal.h" // 48MHz / 1024 = 46.8khz PWM -PWMConfig pumpDacConfig = { +static const PWMConfig pumpDacConfig = { 48'000'000, 1024, nullptr, diff --git a/firmware/pwm.cpp b/firmware/pwm.cpp index 1c96450..ec32667 100644 --- a/firmware/pwm.cpp +++ b/firmware/pwm.cpp @@ -31,7 +31,7 @@ void Pwm::Start() Start(config); } -void Pwm::Start(PWMConfig& config) +void Pwm::Start(const PWMConfig& config) { m_counterFrequency = config.frequency; m_counterPeriod = config.period; diff --git a/firmware/pwm.h b/firmware/pwm.h index 00f83ad..e0fe842 100644 --- a/firmware/pwm.h +++ b/firmware/pwm.h @@ -13,7 +13,7 @@ public: Pwm(PWMDriver& driver); void Start(); - void Start(PWMConfig& config); + void Start(const PWMConfig& config); void SetDuty(int channel, float duty); float GetLastDuty(int channel);