From 94dfa92019a032e2fd2242306c1d18454cfde0e8 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 30 Jan 2025 16:54:08 -0500 Subject: [PATCH] Update main.c try extended JY-1 --- main.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/main.c b/main.c index b9b504f5..4eab3c2c 100644 --- a/main.c +++ b/main.c @@ -2305,7 +2305,8 @@ void get_tlm_fc() { memset(source_bytes, 0x00, sizeof(source_bytes)); // source_bytes[0] = 0b00000001 ; // Sat Id is FunCube-EM source_bytes[0] = 0b11000001 ; // Sat Id is extended - source_bytes[1] = 0x08 ; // extended Nayif +// source_bytes[1] = 0x08 ; // extended Nayify + source_bytes[1] = 0x00 ; // extended JY-1 int extended = 1; // source_bytes[1] = 0b10000010 ; @@ -2326,7 +2327,7 @@ void get_tlm_fc() { uint16_t ib = 0; if (current[map[BAT]] < 0 ) - ic = (uint16_t)(current[map[BAT]] * -1000) && 0x3ff; // charging current + ic = (uint16_t)(current[map[BAT]] * (-1000)) && 0x3ff; // charging current else ib = (uint16_t)(current[map[BAT]] * 1000) && 0x3ff; // supplying current @@ -2397,9 +2398,9 @@ void get_tlm_fc() { // source_bytes[FC_SW + 1] = 0xff & ((unsigned long int)sequence >> 8); // source_bytes[FC_SW + 2] = 0xff & (unsigned long int)sequence++; - source_bytes[extended + 46] = 0xff & ((unsigned long int)sequence >> 16); - source_bytes[extended + 47] = 0xff & ((unsigned long int)sequence >> 8); - source_bytes[extended + 48] = 0xff & (unsigned long int)sequence++; + source_bytes[extended + 45] = 0xff & ((unsigned long int)sequence >> 16); // was 46 + source_bytes[extended + 46] = 0xff & ((unsigned long int)sequence >> 8); + source_bytes[extended + 47] = 0xff & (unsigned long int)sequence++; /**/ printf("\nsource_bytes\n");