Skip to content

Commit

Permalink
More timestamp search updates
Browse files Browse the repository at this point in the history
  • Loading branch information
hedgecrw committed Oct 30, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 0b1ab45 commit 3dd1a63
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions software/firmware/src/peripherals/src/storage.c
Original file line number Diff line number Diff line change
@@ -619,7 +619,7 @@ void storage_begin_reading(uint32_t starting_timestamp, uint32_t ending_timestam
{
const uint32_t potential_timestamp1 = *(uint32_t*)(transfer_buffer + 5 + i);
const uint32_t potential_timestamp2 = *(uint32_t*)(transfer_buffer + 14 + i);
if ((transfer_buffer[4 + i] == STORAGE_TYPE_VOLTAGE) && ((potential_timestamp1 % 500) == 0) && transfer_buffer[13 + i] && (transfer_buffer[13 + i] < STORAGE_NUM_TYPES) && ((potential_timestamp2 % 500) == 0) && (potential_timestamp1 < ending_timestamp))
if ((transfer_buffer[4 + i] == STORAGE_TYPE_VOLTAGE) && ((potential_timestamp1 % 500) == 0) && transfer_buffer[13 + i] && (transfer_buffer[13 + i] < STORAGE_NUM_TYPES) && ((potential_timestamp2 % 500) == 0) && (potential_timestamp1 < ending_timestamp) && ((potential_timestamp2 - potential_timestamp1) <= 600000))
{
found_valid_timestamp = true;
if (potential_timestamp1 >= starting_timestamp)
@@ -692,7 +692,7 @@ uint32_t storage_retrieve_num_data_chunks(uint32_t ending_timestamp)
{
const uint32_t potential_timestamp1 = *(uint32_t*)(transfer_buffer + 5 + i);
const uint32_t potential_timestamp2 = *(uint32_t*)(transfer_buffer + 14 + i);
if ((transfer_buffer[4 + i] == STORAGE_TYPE_VOLTAGE) && ((potential_timestamp1 % 500) == 0) && transfer_buffer[13 + i] && (transfer_buffer[13 + i] < STORAGE_NUM_TYPES) && ((potential_timestamp2 % 500) == 0))
if ((transfer_buffer[4 + i] == STORAGE_TYPE_VOLTAGE) && ((potential_timestamp1 % 500) == 0) && transfer_buffer[13 + i] && (transfer_buffer[13 + i] < STORAGE_NUM_TYPES) && ((potential_timestamp2 % 500) == 0) && ((potential_timestamp2 - potential_timestamp1) <= 600000))
{
found_valid_timestamp = true;
if (potential_timestamp1 > ending_timestamp)

0 comments on commit 3dd1a63

Please sign in to comment.