Skip to content

Commit b1ed81e

Browse files
committed
logging
1 parent 8390dc0 commit b1ed81e

2 files changed

Lines changed: 17 additions & 2 deletions

File tree

Core/Inc/shep_tasks.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@
66
#include "datastructs.h"
77

88
// #define DEBUG_HV_PLATE
9-
// #define DEBUG_RAW_VOLTAGES
9+
#define DEBUG_RAW_VOLTAGES
1010
// #define DEBUG_OCV_VOLTAGES
11-
// #define DEBUG_TEMPS
11+
#define DEBUG_TEMPS
1212
// #define DEBUG_AlGOS
13+
#define DEBUG_SEGMENT_CHIP_DIAGNOSTICS
1314

1415
/* Initializes all ThreadX threads.
1516
* Calls to create_thread() should go in here

Core/Src/shep_tasks.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,20 @@ const void print_bms_stats(analyzer_t *analyzer, hv_plate_t *hv_plate,
5252
PRINTLN_INFO("Secondary Internal Temperature: %.3f C", hv_plate->tmp2);
5353
#endif
5454

55+
#ifdef DEBUG_SEGMENT_CHIP_DIAGNOSTICS
56+
PRINTLN_INFO("Segment Chip Diagnostics:");
57+
printf("Chip DieT(C) VPV VMV Vres Vref2 Vana Vdig\n");
58+
printf("---- ------- ------ ------ ------ ------ ------ ------\n");
59+
for (uint8_t c = 0; c < NUM_CHIPS; c++) {
60+
chipdata_t *cd = &analyzer->chip_data[c];
61+
62+
printf("%-4d %7.1f %6.3f %6.3f %6.3f %6.3f %6.3f %6.3f\n",
63+
c, cd->die_temp, cd->vpv, cd->vmv, cd->v_res,
64+
cd->vref2, cd->v_analog, cd->v_digital);
65+
}
66+
printf("\n");
67+
#endif
68+
5569
#ifdef DEBUG_RAW_VOLTAGES
5670
PRINTLN_INFO("Min, Max, Avg, Delta Voltages: %f, %f, %f, %f\n",
5771
analyzer->min_voltage.val, analyzer->max_voltage.val,

0 commit comments

Comments
 (0)