From 0a117089b8decd0fafd07a4c934c4070cbe2a2e4 Mon Sep 17 00:00:00 2001 From: Matthew Kennedy Date: Wed, 3 Nov 2021 23:02:11 -0700 Subject: [PATCH] uppercase functions --- firmware/fault.cpp | 6 +++--- firmware/fault.h | 10 ++++++---- firmware/heater_control.cpp | 6 +++--- firmware/main.cpp | 2 +- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/firmware/fault.cpp b/firmware/fault.cpp index c315794..1b0ace8 100644 --- a/firmware/fault.cpp +++ b/firmware/fault.cpp @@ -2,17 +2,17 @@ static Fault currentFault = Fault::None; -void setFault(Fault fault) +void SetFault(Fault fault) { currentFault = fault; } -bool hasFault() +bool HasFault() { return currentFault != Fault::None; } -Fault getCurrentFault() +Fault GetCurrentFault() { return currentFault; } diff --git a/firmware/fault.h b/firmware/fault.h index b65813c..b4477e5 100644 --- a/firmware/fault.h +++ b/firmware/fault.h @@ -1,6 +1,8 @@ #pragma once -enum class Fault +#include + +enum class Fault : uint8_t { None = 0, @@ -10,6 +12,6 @@ enum class Fault SensorUnderheat = 5, }; -void setFault(Fault fault); -bool hasFault(); -Fault getCurrentFault(); +void SetFault(Fault fault); +bool HasFault(); +Fault GetCurrentFault(); diff --git a/firmware/heater_control.cpp b/firmware/heater_control.cpp index 54621b5..c270ae1 100644 --- a/firmware/heater_control.cpp +++ b/firmware/heater_control.cpp @@ -61,7 +61,7 @@ static HeaterState GetNextState(HeaterState state, float sensorEsr) } else if (timeCounter == 0) { - setFault(Fault::SensorDidntHeat); + SetFault(Fault::SensorDidntHeat); return HeaterState::Stopped; } @@ -71,12 +71,12 @@ static HeaterState GetNextState(HeaterState state, float sensorEsr) case HeaterState::ClosedLoop: if (sensorEsr < HEATER_OVERHEAT_ESR) { - setFault(Fault::SensorOverheat); + SetFault(Fault::SensorOverheat); return HeaterState::Stopped; } else if (sensorEsr > HEATER_UNDERHEAT_ESR) { - setFault(Fault::SensorUnderheat); + SetFault(Fault::SensorUnderheat); return HeaterState::Stopped; } diff --git a/firmware/main.cpp b/firmware/main.cpp index 3ca7d52..5e69b87 100644 --- a/firmware/main.cpp +++ b/firmware/main.cpp @@ -28,7 +28,7 @@ int main() { while(true) { - auto fault = getCurrentFault(); + auto fault = GetCurrentFault(); if (fault == Fault::None) {