From b3ce845470ea407e832158e34ee69fce1d4be6b1 Mon Sep 17 00:00:00 2001 From: Cameron Goddard Date: Sat, 3 Feb 2024 19:51:55 -0500 Subject: [PATCH] cleanup --- src/ControlTasks/RadioControlTask.cpp | 1 - src/MainControlLoop.cpp | 5 ---- src/Monitors/TempMonitor.cpp | 3 -- src/SensorReading.cpp | 10 ------- src/SensorReading.hpp | 2 -- src/constants.hpp | 43 --------------------------- src/sfr.cpp | 1 - src/sfr.hpp | 1 - 8 files changed, 66 deletions(-) diff --git a/src/ControlTasks/RadioControlTask.cpp b/src/ControlTasks/RadioControlTask.cpp index 8f5a20a..87e8961 100644 --- a/src/ControlTasks/RadioControlTask.cpp +++ b/src/ControlTasks/RadioControlTask.cpp @@ -242,7 +242,6 @@ String RadioControlTask::buildDownlink() packet += sensorReadingString(sfr::imu::acc_y) + ","; packet += sensorReadingString(sfr::imu::acc_z) + ","; packet += sensorReadingString(sfr::temperature::temp_c) + ","; - packet += sensorReadingString(sfr::temperature::temp_f) + ","; // packet = sensorReadingString(sfr::gps::latitude) + ","; // packet += sensorReadingString(sfr::gps::longitude) + ","; packet += sensorReadingString(sfr::gps::altitude) + ","; diff --git a/src/MainControlLoop.cpp b/src/MainControlLoop.cpp index 8794f6c..d8c7cc5 100644 --- a/src/MainControlLoop.cpp +++ b/src/MainControlLoop.cpp @@ -51,11 +51,6 @@ void MainControlLoop::execute() Serial.print(val); Serial.println(F(" C")); } - if (sfr::temperature::temp_f->get_value(&val)) { - Serial.print(F("Temperature (F): ")); - Serial.print(val); - Serial.println(F(" F")); - } if (sfr::gps::latitude->get_value(&val)) { Serial.print(F("GPS Latitude: ")); Serial.println(val); diff --git a/src/Monitors/TempMonitor.cpp b/src/Monitors/TempMonitor.cpp index eacf675..4710877 100644 --- a/src/Monitors/TempMonitor.cpp +++ b/src/Monitors/TempMonitor.cpp @@ -10,7 +10,6 @@ void TempMonitor::execute() { if (!initialized) { sfr::temperature::temp_c->set_valid(); - sfr::temperature::temp_f->set_valid(); initialized = true; } @@ -32,8 +31,6 @@ void TempMonitor::execute() // Convert the data uint32_t rawtemp = (data[0] * 256 + data[1]) & 0xFFFC; float temp_c = -46.85 + (175.72 * (rawtemp / 65536.0)); - float temp_f = temp_c * 1.8 + 32; sfr::temperature::temp_c->set_value(temp_c); - sfr::temperature::temp_f->set_value(temp_f); } diff --git a/src/SensorReading.cpp b/src/SensorReading.cpp index 761ad08..024fc09 100644 --- a/src/SensorReading.cpp +++ b/src/SensorReading.cpp @@ -41,16 +41,6 @@ void SensorReading::set_invalid() value = -1; } -float SensorReading::get_max() -{ - return max; -} - -float SensorReading::get_min() -{ - return min; -} - bool SensorReading::is_valid() { return valid; diff --git a/src/SensorReading.hpp b/src/SensorReading.hpp index e1dc6cf..c8276c4 100644 --- a/src/SensorReading.hpp +++ b/src/SensorReading.hpp @@ -18,8 +18,6 @@ class SensorReading void set_value(float x); // set SensorReading value void set_invalid(); void set_valid(); - float get_min(); - float get_max(); bool is_valid(); }; diff --git a/src/constants.hpp b/src/constants.hpp index 8f64dfe..8694efc 100644 --- a/src/constants.hpp +++ b/src/constants.hpp @@ -1,20 +1,12 @@ #ifndef CONSTANTS_HPP_ #define CONSTANTS_HPP_ -#include - namespace constants { namespace time { constexpr unsigned long one_second = 1000; constexpr unsigned long one_minute = 60 * one_second; constexpr unsigned long one_hour = 60 * one_minute; - constexpr unsigned long one_day = 24 * one_hour; - constexpr unsigned long half_second = one_second / 2; } // namespace time - namespace sensor { - constexpr int collect = 3; - constexpr int repeats = 10; - } // namespace sensor namespace radio { constexpr int radio_cs_pin = 10; constexpr int radio_di0_pin = 2; @@ -36,45 +28,10 @@ namespace constants { constexpr int pl = 8; constexpr int gn = 0; - // constexpr size_t buffer_size = 63; - // constexpr size_t packet_size = 70; - // constexpr size_t num_commas = 5; - // constexpr size_t opcode_len = 2; - // constexpr size_t arg1_len = 4; - // constexpr size_t arg2_len = 4; - // constexpr size_t command_len = opcode_len + arg1_len + arg2_len; - // constexpr size_t max_conseq_read = 3; - - // constexpr uint8_t end_of_normal_downlink_flag1 = 254; - // constexpr uint8_t end_of_normal_downlink_flag2 = 255; - // constexpr uint8_t end_of_command_upload_flag1 = 0; - // constexpr uint8_t end_of_command_upload_flag2 = 250; - // namespace opcodes { - // // SFRField Commands - // constexpr uint16_t sfr_field_opcode_min = 0x1100; - // constexpr uint16_t sfr_field_opcode_max = 0x2899; - - // // Deploy Command - // constexpr uint16_t sfr_field_opcode_deploy = 0x3333; - - // // Arm Command - // constexpr uint16_t sfr_field_opcode_arm = 0x4444; - - // // Fire Command - // constexpr uint16_t sfr_field_opcode_fire = 0x5555; - - // } // namespace opcodes } // namespace radio - namespace temperature { constexpr int i2c_address = 0x4A; } // namespace temperature - namespace imu { - - } // namespace imu - namespace gps { - constexpr int dog_size = 62; - } // namespace gps }; // namespace constants diff --git a/src/sfr.cpp b/src/sfr.cpp index b34646a..3d08e0e 100644 --- a/src/sfr.cpp +++ b/src/sfr.cpp @@ -23,7 +23,6 @@ namespace sfr { namespace temperature { SensorReading *temp_c = new SensorReading(-5000, 5000); - SensorReading *temp_f = new SensorReading(-10000, 10000); } // namespace temperature namespace gps { diff --git a/src/sfr.hpp b/src/sfr.hpp index c3a176a..4b6d1f0 100644 --- a/src/sfr.hpp +++ b/src/sfr.hpp @@ -26,7 +26,6 @@ namespace sfr { } // namespace imu namespace temperature { extern SensorReading *temp_c; - extern SensorReading *temp_f; } // namespace temperature namespace radio { extern sensor_init_mode_type init_mode;