-
Notifications
You must be signed in to change notification settings - Fork 2
wn/WDT #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
wn/WDT #11
Conversation
Cpp-Linter Report
|
billofright
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really good start! A few structural things here and there but it's really good code. Try testing this on an actual teensy when you get the chance. Also, reminder to change the name of the PR to a relevant description!
…ested on hardware
…lect these changes.
…eflect these changes.
…re no arguments to 'constrain' that depend on a template parameter, so a declaration of 'constrain' must be available [-fpermissive]
152 | config.trigger = constrain(config.trigger, 0.0f, 127.5); /* callback trigger before timeout */
| ^~~~~~~~~
.pio\libdeps\teensy41\WDT_T4/Watchdog_t4.tpp:152:20: warning: there are no arguments to 'constrain' that depend on a template parameter, so a declaration of 'constrain' must be available [-fpermissive]
152 | config.trigger = constrain(config.trigger, 0.0f, 127.5); /* callback trigger before timeout */
| ^~~~~~~~~# On branch wn/watchdog
| @@ -0,0 +1,16 @@ | |||
| { | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is this file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
im not sure why its there, it mightve been bc i saved it as a workspace. this file can be deleted.
fsae-vehicle-fw/src/main.cpp
Outdated
|
|
||
| void threadMain(void *pvParameters) { | ||
| Serial.begin(9600); | ||
| vTaskDelay(pdMS_TO_TICKS(100)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
each tick is by default 1ms so u dont have to do pdms_to_ticks
| } | ||
|
|
||
| void myCallBack(){ | ||
| Serial.println("WARNING: WATCHDOG NEEDS TO BE PET."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does it reboot the teensy?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea, if Watchdog_pet() isnt called, the trigger point will be reached and then the system will reset automatically once the timeout window ends.
… function for better readibility
Change Description
Implemented hardware WDT to work with FreeRTOS.
Why the change is needed and implementation details
Needed as a safety feature to ensure that all sensors are working, if not then we reset the teensy.
Testing and validation
Tested by commenting out the Watchdog_Pet() line and added several print statements to track system flow. If Watchdog_Pet() is not called, the trigger statement will print to warn that system reset is happening and then once the timeout window closes, a statement will print and the system will reset automatically.