Skip to content
This repository was archived by the owner on Jun 2, 2025. It is now read-only.

Commit 1abc1cc

Browse files
committed
Misc fixes for self diagnostic, add missing heater setpoint checks
1 parent 9d13c09 commit 1abc1cc

File tree

1 file changed

+18
-7
lines changed
  • harness_tests/self_diagnostic

1 file changed

+18
-7
lines changed

harness_tests/self_diagnostic/main1.c

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,19 @@ void read_temp_test(void) {
181181
temp = adc_raw_to_therm_temp(raw_data_temp);
182182
ASSERT_FP_GREATER(temp, 20.0);
183183
ASSERT_FP_LESS(temp, 30.0);
184+
185+
uint32_t raw_data_sp = 0;
186+
double sp = 0;
187+
188+
/* Heater 1 setpoint */
189+
raw_data_sp = construct_rx_msg(CAN_EPS_HK, CAN_EPS_HK_HEAT1_SP, 0x00);
190+
sp = dac_raw_data_to_heater_setpoint(raw_data_sp);
191+
ASSERT_FP_EQ(sp, 25.0);
192+
193+
/* Heater 2 setpoint */
194+
raw_data_sp = construct_rx_msg(CAN_EPS_HK, CAN_EPS_HK_HEAT2_SP, 0x00);
195+
sp = dac_raw_data_to_heater_setpoint(raw_data_sp);
196+
ASSERT_FP_EQ(sp, 25.0);
184197
}
185198

186199
/* Verifies that battery pack current increases by between 0.15A and 0.2A for each heater
@@ -405,20 +418,18 @@ void imu_test(void) {
405418

406419
/* Asserts that the uptime value sent is within valid range */
407420
void uptime_test(void){
408-
construct_rx_msg(CAN_EPS_HK, CAN_EPS_HK_UPTIME, 0x00);
409-
uint32_t tx_data = uptime_s;
410-
ASSERT_FP_GREATER(tx_data, 1); /* 1 second */
411-
ASSERT_FP_LESS(tx_data, 60); /* 60 seconds */
421+
uint32_t tx_data = construct_rx_msg(CAN_EPS_HK, CAN_EPS_HK_UPTIME, 0x00);
422+
ASSERT_GREATER(tx_data, 1); /* 1 second */
423+
ASSERT_LESS(tx_data, 60); /* 60 seconds */
412424
}
413425

414426
/* Asserts that the restart count value sent is within valid range */
415427
void restart_test(void){
416428
uint32_t restart_count = construct_rx_msg(CAN_EPS_HK, CAN_EPS_HK_RESTART_COUNT, 0x00);
417-
ASSERT_FP_GREATER(restart_count, 1);
418-
ASSERT_FP_LESS(restart_count, 1000);
429+
ASSERT_EQ(restart_count, 1);
419430

420431
uint32_t restart_reason = construct_rx_msg(CAN_EPS_HK, CAN_EPS_HK_RESTART_REASON, 0x00);
421-
ASSERT_EQ(restart_reason, 0x06);
432+
ASSERT_EQ(restart_reason, UPTIME_RESTART_REASON_EXTRF);
422433
}
423434

424435

0 commit comments

Comments
 (0)