Skip to content

devices have different upper and lower temperature bounds depending on the car's current state.#350

Open
maxr21 wants to merge 2 commits intodevelopfrom
feature/temp_bounds_for_each_state
Open

devices have different upper and lower temperature bounds depending on the car's current state.#350
maxr21 wants to merge 2 commits intodevelopfrom
feature/temp_bounds_for_each_state

Conversation

@maxr21
Copy link
Contributor

@maxr21 maxr21 commented Aug 12, 2025

Devices have different upper and lower temperature bounds depending on the car's current state.

Changes

added a struct and sub-struct to hold each cooling device's temperature bounds for each possible car state.
Changed the debounce function to check temperature against bounds for the current car state.

Notes

This will probably be changed soon to allow a csv to be read in to set the upper and lower temp bounds.

Closes #329

@maxr21 maxr21 self-assigned this Aug 12, 2025
Copy link
Contributor

@jr1221 jr1221 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very cool. Please add a default state used if no other states are used. be careful about garbage data here, please read about tagged unions or doing NULL checks.

bool below_min_temp = temp < device_bounds.lower_motor_temp_bound;

if (above_max_temp) {
debounce(above_max_temp, &(device->timer), 10000, set_device_on,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please #define the time for debounce (might already exist)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add cooling profiles

2 participants