-
Notifications
You must be signed in to change notification settings - Fork 5
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
disable subsystems when hardware disconnects #153
Conversation
Co-authored-by: suhas <[email protected]>
Co-authored-by: Arjun Chati <[email protected]>
hardware test results:
|
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.
Thanks for putting this together -- great work! I've added some comments for changes throughout the code if you could take a look at those.
With the UTSubsystem parent class, I have an idea which might simplify things a bit: Currently, each UTSubsystem has to run setAmputated(!hardwareOk())
manually on refresh, but really this can be done in the background for every subsystem. I think the best way to do this would actually subclass the CommandScheduler
. i.e.
void CommandScheduler::run()
{
#ifndef PLATFORM_HOSTED
uint32_t runStart = arch::clock::getTimeMicroseconds();
#endif
// We can insert our custom hardware checks here:
for (auto it = subMapBegin(); it != subMapEnd(); it++)
{
Subsystem *sub = *it;
sub->setAmputated(sub->hardwareOk());
}
// This is the built-in hardware checking system
if (runningHardwareTests)
{
// Call runHardwareTests on all subsystems in the registeredSubsystemBitmap
// if a hardware test is not already complete
for (auto it = subMapBegin(); it != subMapEnd(); it++)
{
Subsystem *sub = *it;
if (!sub->isHardwareTestComplete())
{
sub->runHardwareTests();
}
sub->refresh();
}
return;
}
(...)
Update: nevermind looks like you can't change the CommandScheduler so easily, so let's leave that for later.
@MChung04 this is similar to the hardware checks you're working on. Might be some helpful stuff in here or implementations that can be shared between the tasks |
Looks like clang-format is mad about |
hardware test 2: seems like flywheel isn't turning off |
Fixed the flywheel and hero build issue. I removed the Otherwise looks great -- thanks! |
resolves #149
(currently untested)