Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
cameron-goddard committed Feb 4, 2024
1 parent 11b8f50 commit b3ce845
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 66 deletions.
1 change: 0 additions & 1 deletion src/ControlTasks/RadioControlTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) + ",";
Expand Down
5 changes: 0 additions & 5 deletions src/MainControlLoop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 0 additions & 3 deletions src/Monitors/TempMonitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ void TempMonitor::execute()
{
if (!initialized) {
sfr::temperature::temp_c->set_valid();
sfr::temperature::temp_f->set_valid();
initialized = true;
}

Expand All @@ -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);
}
10 changes: 0 additions & 10 deletions src/SensorReading.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 0 additions & 2 deletions src/SensorReading.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
};

Expand Down
43 changes: 0 additions & 43 deletions src/constants.hpp
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
#ifndef CONSTANTS_HPP_
#define CONSTANTS_HPP_

#include <stdint.h>

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;
Expand All @@ -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

Expand Down
1 change: 0 additions & 1 deletion src/sfr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 0 additions & 1 deletion src/sfr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b3ce845

Please sign in to comment.