Skip to content

Commit

Permalink
feat: Add 64_t support
Browse files Browse the repository at this point in the history
  • Loading branch information
flap1 committed May 26, 2024
1 parent 6731ea3 commit ca2ef0f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
10 changes: 10 additions & 0 deletions TlmCmd/telemetry_frame.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ void TF_copy_u32(uint8_t* ptr, uint32_t data)
ENDIAN_memcpy(ptr, &data, 4);
}

void TF_copy_u64(uint8_t* ptr, uint64_t data)
{
ENDIAN_memcpy(ptr, &data, 8);
}

void TF_copy_i8(uint8_t* ptr, int8_t data)
{
ptr[0] = (uint8_t)data;
Expand All @@ -89,6 +94,11 @@ void TF_copy_i32(uint8_t* ptr, int32_t data)
ENDIAN_memcpy(ptr, &data, 4);
}

void TF_copy_i64(uint8_t* ptr, int64_t data)
{
ENDIAN_memcpy(ptr, &data, 8);
}

void TF_copy_float(uint8_t* ptr, float data)
{
ENDIAN_memcpy(ptr, &data, sizeof(float));
Expand Down
4 changes: 4 additions & 0 deletions TlmCmd/telemetry_frame.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,16 @@ void TF_copy_u16(uint8_t* ptr, uint16_t data);

void TF_copy_u32(uint8_t* ptr, uint32_t data);

void TF_copy_u64(uint8_t* ptr, uint64_t data);

void TF_copy_i8(uint8_t* ptr, int8_t data);

void TF_copy_i16(uint8_t* ptr, int16_t data);

void TF_copy_i32(uint8_t* ptr, int32_t data);

void TF_copy_i64(uint8_t* ptr, int64_t data);

void TF_copy_float(uint8_t* ptr, float data);

void TF_copy_double(uint8_t* ptr, double data);
Expand Down

0 comments on commit ca2ef0f

Please sign in to comment.