Skip to content

Commit

Permalink
fixes and testing environment settings
Browse files Browse the repository at this point in the history
  • Loading branch information
dhacks541 committed Dec 13, 2024
1 parent fd77add commit 6dcd48a
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
11 changes: 10 additions & 1 deletion src/Control Tasks/CameraControlTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ void CameraControlTask::execute()
Serial.println("Failed to snap!");
#endif
} else {
Serial.print("photo time: ");
Serial.println(millis());
jpglen = adaCam.frameLength();
#ifdef VERBOSE
Serial.println("\n\n\nOptical sensor data captured!\n\n\n");
Expand Down Expand Up @@ -209,9 +211,16 @@ void CameraControlTask::execute()
#endif
if (sfr::camera::images_written == 1) {
sfr::camera::take_photo = true;
if (!adaCam.resumeVideo()) {
#ifdef VERBOSE
Serial.println("Triggering second activation of optical sensor");
Serial.println("Failed to resume camera frame!");
#endif
sfr::camera::power_setting = (uint8_t)sensor_power_mode_type::off;
} else {
#ifdef VERBOSE
Serial.println("Triggering second activation of optical sensor");
#endif
}
}
if (sfr::camera::images_written >= 2) {
sfr::camera::power_setting = (uint8_t)sensor_power_mode_type::off;
Expand Down
10 changes: 9 additions & 1 deletion src/Monitors/ButtonMonitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ void ButtonMonitor::execute()
fault_groups::hardware_faults::button->force();
}
} else {
sfr::button::pressed = true;
if (sfr::mission::possible_uncovered) {
if (sfr::button::button_pressed) {
Serial.print("button time: ");
Serial.println(millis());
}
sfr::button::button_pressed = false;
} else {
sfr::button::pressed = true;
}
}
}
8 changes: 4 additions & 4 deletions src/sfr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ namespace sfr {
namespace stabilization {
// OP Codes 1100
// TODO actual default value
SFRField<uint32_t> max_time = SFRField<uint32_t>(2 * constants::time::one_minute, 0x1100);
SFRField<uint32_t> max_time = SFRField<uint32_t>(2 * constants::time::one_hour, 0x1100);
} // namespace stabilization
namespace boot {
// OP Codes 1200
SFRField<uint32_t> max_time = SFRField<uint32_t>(2 * constants::time::one_minute, 0x1200);
SFRField<uint32_t> max_time = SFRField<uint32_t>(2 * constants::time::one_hour, 0x1200);
} // namespace boot
namespace detumble {
// OP Codes 1500
Expand All @@ -23,7 +23,7 @@ namespace sfr {
SFRField<bool> downlinked = SFRField<bool>(false, 0x1600);
SFRField<uint16_t> max_downlink_hard_faults = SFRField<uint16_t>(3, 0x1601);
SFRField<uint16_t> num_hard_faults = SFRField<uint16_t>(0, 0x1602);
SFRField<uint32_t> max_time = SFRField<uint32_t>(2 * constants::time::one_minute, 0x1603);
SFRField<uint32_t> max_time = SFRField<uint32_t>(2 * constants::time::one_hour, 0x1603);
} // namespace aliveSignal
namespace photoresistor {
// OP Codes 1700
Expand Down Expand Up @@ -153,7 +153,7 @@ namespace sfr {
SFRField<uint32_t> last_downlink = SFRField<uint32_t>(0, 0x2108);
SFRField<uint32_t> downlink_period = SFRField<uint32_t>(20 * constants::time::one_minute, 0, 2 * constants::time::one_day, 0x2109);
SFRField<uint32_t> lp_downlink_period = SFRField<uint32_t>(constants::time::one_hour, constants::time::one_second, 2 * constants::time::one_day, 0x2110);
SFRField<uint32_t> transmit_downlink_period = SFRField<uint32_t>(5 * constants::time::one_minute, constants::time::one_second, 2 * constants::time::one_day, 0x2111);
SFRField<uint32_t> transmit_downlink_period = SFRField<uint32_t>(1 * constants::time::one_minute, constants::time::one_second, 2 * constants::time::one_day, 0x2111);
SFRField<uint32_t> on_time = SFRField<uint32_t>(35 * constants::time::one_minute, 0, constants::time::one_revolution, 0x2112);

char buffer[constants::rockblock::buffer_size] = {0};
Expand Down

0 comments on commit 6dcd48a

Please sign in to comment.