24{
26
27
28 for (int i = 0; i < (1 << 10); ++i) {
29 DASHBOARD_STATE_t current_state;
30 current_state.start_button = (uint8_t)((i & (1 << 9)) >> 9);
31 current_state.mark_button = (uint8_t)((i & (1 << 8)) >> 8);
32 current_state.mode_button = (uint8_t)((i & (1 << 7)) >> 7);
33 current_state.motor_controller_cycle_button = (uint8_t)((i & (1 << 6)) >> 6);
34 current_state.launch_ctrl_button = (uint8_t)((i & (1 << 5)) >> 5);
35 current_state.torque_mode_button = (uint8_t)((i & (1 << 4)) >> 4);
36 current_state.led_dimmer_button = (uint8_t)((i & (1 << 3)) >> 3);
37 current_state.left_shifter_button = (uint8_t)((i & (1 << 2)) >> 2);
38 current_state.right_shifter_button = (uint8_t)((i & (1 << 1)) >> 1);
39 current_state.shutdown_h_above_threshold = (uint8_t)(i & 1);
40
42 msg.id= Pack_DASHBOARD_STATE_hytech(¤t_state,
msg.buf, &
msg.len, (uint8_t*) &
msg.flags.extended);
43
44 dash_interface.read(
msg);
45
46 TEST_ASSERT_EQUAL(current_state.start_button, dash_interface.startButtonPressed() );
47 TEST_ASSERT_EQUAL(current_state.mark_button, dash_interface.specialButtonPressed() );
48 TEST_ASSERT_EQUAL(current_state.mode_button , dash_interface.torqueModeButtonPressed() );
49 TEST_ASSERT_EQUAL(current_state.motor_controller_cycle_button, dash_interface.inverterResetButtonPressed() );
50 TEST_ASSERT_EQUAL(current_state.launch_ctrl_button , dash_interface.launchControlButtonPressed() );
51 TEST_ASSERT_EQUAL(current_state.torque_mode_button , dash_interface.torqueLoadingButtonPressed() );
52 TEST_ASSERT_EQUAL(current_state.led_dimmer_button , dash_interface.nightModeButtonPressed() );
53 TEST_ASSERT_EQUAL(current_state.left_shifter_button, dash_interface.leftShifterButtonPressed() );
54 TEST_ASSERT_EQUAL(current_state.right_shifter_button , dash_interface.rightShifterButtonPressed() );
55 TEST_ASSERT_EQUAL(current_state.shutdown_h_above_threshold , dash_interface.shutdownHAboveThreshold() );
56
57 }
58
59
60
61}
CANBufferType dash_CAN_buffer