From bb5f3e82713d43b32cc699731ff0435209f370c5 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Tue, 28 Jan 2025 15:34:27 -0500 Subject: [PATCH] Update main.c add bat volt current resets --- main.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index 5964d3b2..9eed0416 100644 --- a/main.c +++ b/main.c @@ -2304,7 +2304,12 @@ void get_tlm_fc() { memset(source_bytes, 0x00, sizeof(source_bytes)); source_bytes[0] = 0b00000001 ; // 10100000 10000001 01000001 10000001 10000001 source_bytes[1] = 0b10000010 ; - source_bytes[10] = (uint8_t) rnd_float(0,255); + source_bytes[10] = 0xff & ((voltage[map[BAT]] * 1000) >> 8); + source_bytes[11] = 0xff & (voltage[map[BAT]] * 1000); + source_bytes[10] = 0xff & ((current[map[BAT]] * 1000) >> 8); + source_bytes[11] = 0xff & (current[map[BAT]] * 1000); + source_bytes[14] = 0xff & ((unsigned long int)reset_count >> 8); + source_bytes[15] = 0xff & (unsigned long int)reset_count; source_bytes[50] = 0xff & ((unsigned long int)sequence >> 16); // Sequence number source_bytes[51] = 0xff & ((unsigned long int)sequence >> 8); source_bytes[52] = 0xff & (unsigned long int)sequence++;