From 7ca536fbe58c82d8fe9ef600a128d853c775edac Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 30 Jan 2025 13:20:04 -0500 Subject: [PATCH] Update main.c fix currents --- main.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/main.c b/main.c index 5a56fdee..45b7c8ce 100644 --- a/main.c +++ b/main.c @@ -2318,15 +2318,14 @@ void get_tlm_fc() { uint16_t ix = (uint16_t)((current[map[PLUS_X]] + current[map[MINUS_X]]) * 1000) && 0x3ff; // 10 bits uint16_t iy = (uint16_t)((current[map[PLUS_Y]] + current[map[MINUS_Y]]) * 1000) && 0x3ff; uint16_t iz = (uint16_t)((current[map[PLUS_Z]] + current[map[MINUS_Z]]) * 1000) && 0x3ff; + + uint16_t ic = 0, + uint16_t ib = 0; - if (current[map[BAT]] < 0 ) { - uint16_t ic = (uint16_t)(current[map[BAT]] * -1000) && 0x3ff; // charging current - uint16_t ib = 0; - } - else { - uint16_t ic = 0; - uint16_t ib = (uint16_t)(current[map[BAT]] * 1000) && 0x3ff; // supplying current - } + if (current[map[BAT]] < 0 ) + ic = (uint16_t)(current[map[BAT]] * -1000) && 0x3ff; // charging current + else + ib = (uint16_t)(current[map[BAT]] * 1000) && 0x3ff; // supplying current // x = 0xfffc; // 0xffff; // y = 0x0; // 0x0000;