Review eFuse thread to toggle states based on temperature#133
Review eFuse thread to toggle states based on temperature#133
Conversation
caiodasilva2005
left a comment
There was a problem hiding this comment.
Awesome Sogo thank you for your work on this.
We also need an array that stores the states that telemetry want all efuses in. For instance, we want to be able to receive a can message with an efuse id (0 = EFUSE_PUMP1, 1 = EFUSE_PUMP2 etc...) and a state (ON = 1, OFF = 0) to determine if we want to enable a particular efuse on or off over CAN.
I suggest having a global array called calypso_states that is the size of the number of EFUSES all initialized to 0. if we receive a CAN messagewith id 1, and state 1 then you update index 1 of the array to 1. If the index of the array is 1 then enable the efuse automatically. If the Array is 0 then do one of two things:
- Automatically disable it if it does not rely on a temperature/threshold
- Let it continue in its original loop and turn off when it goes under the temperature/threshold
TLDR the state of the array should take priority, and then we should fall back on what the default functionality is
| uint16_t motor_temp = dti_get_motor_temp(); | ||
| uint16_t controller_temp = dti_get_controller_temp(); | ||
|
|
||
| if (motor_temp > PUMP1_UPPER_MOTOR_TEMP) { |
There was a problem hiding this comment.
Take a look at our debounce() implementation in debounce.c in Embedded-Base. We should be able to configure hoe long this condition stays true for the efuse to be enabled
Changes
Refactored the eFuse thread to simplify the code and added a new method to control eFuse states based on motor and motor controller (MC) temperatures.
Notes
u_efuses.h.Cerberus.Test Cases
To Do
Checklist
It can be helpful to check the
ChecksandFiles changedtabs.Please reach out to your Project Lead if anything is unclear.
Please request reviewers and ping on slack only after you've gone through this whole checklist.
Closes # (issue #130 )