sample_t: fixup comments (#921)

This commit is contained in:
Shane Smiskol 2022-04-21 20:11:13 -07:00 committed by GitHub
parent 7dd9493eb1
commit ee2a4b6b58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -320,7 +320,7 @@ int to_signed(int d, int bits) {
return d_signed;
}
// given a new sample, update the smaple_t struct
// given a new sample, update the sample_t struct
void update_sample(struct sample_t *sample, int sample_new) {
int sample_size = sizeof(sample->values) / sizeof(sample->values[0]);
for (int i = sample_size - 1; i > 0; i--) {

View File

@ -7,7 +7,7 @@
const int MAX_WRONG_COUNTERS = 5;
const uint8_t MAX_MISSED_MSGS = 10U;
// sample struct that keeps 3 samples in memory
// sample struct that keeps 6 samples in memory
struct sample_t {
int values[6];
int min;
@ -118,14 +118,14 @@ int cruise_button_prev = 0;
// for safety modes with torque steering control
int desired_torque_last = 0; // last desired steer torque
int rt_torque_last = 0; // last desired torque for real time check
struct sample_t torque_meas; // last 3 motor torques produced by the eps
struct sample_t torque_driver; // last 3 driver torques measured
struct sample_t torque_meas; // last 6 motor torques produced by the eps
struct sample_t torque_driver; // last 6 driver torques measured
uint32_t ts_last = 0;
// for safety modes with angle steering control
uint32_t ts_angle_last = 0;
int desired_angle_last = 0;
struct sample_t angle_meas; // last 3 steer angles
struct sample_t angle_meas; // last 6 steer angles
// This can be set with a USB command
// It enables features that allow alternative experiences, like not disengaging on gas press