blob: 931a3e0898368f8f21cebb3f69f31e90ca6f1f77 [file] [log] [blame]
Brandon Wyman24e422f2017-07-25 19:40:14 -05001/**
2 * Copyright © 2017 IBM Corporation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
Brandon Wyman442035f2017-08-08 15:58:45 -050016#include <phosphor-logging/log.hpp>
17#include <phosphor-logging/elog.hpp>
Brandon Wymane0eb45c2017-10-06 12:58:42 -050018#include <org/open_power/Witherspoon/Fault/error.hpp>
Matt Spinlerceacf942017-10-05 13:55:02 -050019#include <xyz/openbmc_project/Common/Device/error.hpp>
Brandon Wyman442035f2017-08-08 15:58:45 -050020#include "elog-errors.hpp"
Brandon Wyman10295542017-08-09 18:20:44 -050021#include "names_values.hpp"
Brandon Wyman24e422f2017-07-25 19:40:14 -050022#include "power_supply.hpp"
Brandon Wyman442035f2017-08-08 15:58:45 -050023#include "pmbus.hpp"
24#include "utility.hpp"
25
26using namespace phosphor::logging;
Brandon Wymane0eb45c2017-10-06 12:58:42 -050027using namespace sdbusplus::org::open_power::Witherspoon::Fault::Error;
Matt Spinlerceacf942017-10-05 13:55:02 -050028using namespace sdbusplus::xyz::openbmc_project::Common::Device::Error;
Brandon Wyman24e422f2017-07-25 19:40:14 -050029
Brandon Wyman1db9a9e2017-07-26 18:50:22 -050030namespace witherspoon
Brandon Wyman24e422f2017-07-25 19:40:14 -050031{
32namespace power
33{
34namespace psu
35{
36
Brandon Wyman10295542017-08-09 18:20:44 -050037constexpr auto INVENTORY_OBJ_PATH = "/xyz/openbmc_project/inventory";
38constexpr auto INVENTORY_INTERFACE = "xyz.openbmc_project.Inventory.Item";
39constexpr auto PRESENT_PROP = "Present";
Brandon Wyman431fbe42017-08-18 16:22:09 -050040constexpr auto POWER_OBJ_PATH = "/org/openbmc/control/power0";
41constexpr auto POWER_INTERFACE = "org.openbmc.control.Power";
Brandon Wyman10295542017-08-09 18:20:44 -050042
43PowerSupply::PowerSupply(const std::string& name, size_t inst,
Brandon Wyman431fbe42017-08-18 16:22:09 -050044 const std::string& objpath,
45 const std::string& invpath,
46 sdbusplus::bus::bus& bus,
47 event::Event& e,
Brandon Wyman590fc282017-11-01 18:22:25 -050048 std::chrono::seconds& t,
49 std::chrono::seconds& p)
Brandon Wyman431fbe42017-08-18 16:22:09 -050050 : Device(name, inst), monitorPath(objpath), pmbusIntf(objpath),
Brandon Wyman50bb85d2017-11-01 18:36:00 -050051 inventoryPath(INVENTORY_OBJ_PATH + invpath), bus(bus), event(e),
52 presentInterval(p),
Brandon Wyman590fc282017-11-01 18:22:25 -050053 presentTimer(e, [this]()
54 {
55 this->present = true;
56 }),
57 powerOnInterval(t),
Brandon Wyman431fbe42017-08-18 16:22:09 -050058 powerOnTimer(e, [this]()
59 {
60 this->powerOn = true;
61 })
Brandon Wyman10295542017-08-09 18:20:44 -050062{
Brandon Wyman10295542017-08-09 18:20:44 -050063 using namespace sdbusplus::bus;
Brandon Wyman10295542017-08-09 18:20:44 -050064 presentMatch = std::make_unique<match_t>(bus,
65 match::rules::propertiesChanged(
Brandon Wyman50bb85d2017-11-01 18:36:00 -050066 inventoryPath,
Brandon Wyman10295542017-08-09 18:20:44 -050067 INVENTORY_INTERFACE),
68 [this](auto& msg)
Brandon Wyman431fbe42017-08-18 16:22:09 -050069 {
70 this->inventoryChanged(msg);
71 });
72 // Get initial presence state.
Brandon Wyman253dc9b2017-08-12 13:45:52 -050073 updatePresence();
Brandon Wyman431fbe42017-08-18 16:22:09 -050074
75 // Subscribe to power state changes
76 powerOnMatch = std::make_unique<match_t>(bus,
77 match::rules::propertiesChanged(
78 POWER_OBJ_PATH,
79 POWER_INTERFACE),
80 [this](auto& msg)
81 {
82 this->powerStateChanged(msg);
83 });
84 // Get initial power state.
85 updatePowerState();
Brandon Wyman10295542017-08-09 18:20:44 -050086}
Brandon Wyman442035f2017-08-08 15:58:45 -050087
Brandon Wymana1e96342017-09-25 16:47:44 -050088void PowerSupply::captureCmd(util::NamesValues& nv, const std::string& cmd,
89 witherspoon::pmbus::Type type)
90{
91 if (pmbusIntf.exists(cmd, type))
92 {
93 try
94 {
95 auto val = pmbusIntf.read(cmd, type);
96 nv.add(cmd, val);
97 }
98 catch (std::exception& e)
99 {
100 log<level::INFO>("Unable to capture metadata", entry("CMD=%s",
101 cmd));
102 }
103 }
104}
Brandon Wyman431fbe42017-08-18 16:22:09 -0500105
Brandon Wyman1db9a9e2017-07-26 18:50:22 -0500106void PowerSupply::analyze()
107{
Brandon Wyman442035f2017-08-08 15:58:45 -0500108 using namespace witherspoon::pmbus;
109
110 try
111 {
Brandon Wyman10295542017-08-09 18:20:44 -0500112 if (present)
Brandon Wyman442035f2017-08-08 15:58:45 -0500113 {
Brandon Wyman764c7972017-08-22 17:05:36 -0500114 std::uint16_t statusWord = 0;
Brandon Wyman764c7972017-08-22 17:05:36 -0500115
116 // Read the 2 byte STATUS_WORD value to check for faults.
117 statusWord = pmbusIntf.read(STATUS_WORD, Type::Debug);
118
Brandon Wymanbee81612017-11-01 18:24:43 -0500119 //TODO: openbmc/openbmc#2484 Three consecutive reads should be
120 // performed.
Brandon Wyman10295542017-08-09 18:20:44 -0500121 // If 3 consecutive reads are seen, log the fault.
122 // Driver gives cached value, read once a second.
123 // increment for fault on, decrement for fault off, to deglitch.
124 // If count reaches 3, we have fault. If count reaches 0, fault is
125 // cleared.
126
Brandon Wyman603cc002017-08-28 18:17:58 -0500127 checkInputFault(statusWord);
Brandon Wyman764c7972017-08-22 17:05:36 -0500128
Brandon Wyman3343e822017-11-03 16:54:11 -0500129 if (powerOn && !faultFound)
Brandon Wyman764c7972017-08-22 17:05:36 -0500130 {
Brandon Wyman12661f12017-08-31 15:28:21 -0500131 checkFanFault(statusWord);
Brandon Wyman875b3632017-09-13 18:46:03 -0500132 checkTemperatureFault(statusWord);
Brandon Wymancfa032b2017-09-25 17:37:50 -0500133 checkOutputOvervoltageFault(statusWord);
134 checkCurrentOutOverCurrentFault(statusWord);
135 checkPGOrUnitOffFault(statusWord);
Brandon Wyman442035f2017-08-08 15:58:45 -0500136 }
137 }
138 }
139 catch (ReadFailure& e)
140 {
141 if (!readFailLogged)
142 {
143 commit<ReadFailure>();
144 readFailLogged = true;
Brandon Wyman442035f2017-08-08 15:58:45 -0500145 }
146 }
147
Brandon Wyman1db9a9e2017-07-26 18:50:22 -0500148 return;
149}
150
Brandon Wyman10295542017-08-09 18:20:44 -0500151void PowerSupply::inventoryChanged(sdbusplus::message::message& msg)
152{
153 std::string msgSensor;
154 std::map<std::string, sdbusplus::message::variant<uint32_t, bool>> msgData;
155 msg.read(msgSensor, msgData);
156
157 // Check if it was the Present property that changed.
158 auto valPropMap = msgData.find(PRESENT_PROP);
159 if (valPropMap != msgData.end())
160 {
161 present = sdbusplus::message::variant_ns::get<bool>(valPropMap->second);
162
163 if (present)
164 {
Brandon Wyman6ccce0b2017-10-26 15:13:10 -0500165 clearFaults();
Brandon Wyman590fc282017-11-01 18:22:25 -0500166 presentTimer.start(presentInterval, Timer::TimerType::oneshot);
167 }
168 else
169 {
170 presentTimer.stop();
Brandon Wyman10295542017-08-09 18:20:44 -0500171 }
172 }
173
174 return;
175}
176
177void PowerSupply::updatePresence()
178{
179 // Use getProperty utility function to get presence status.
Brandon Wyman10295542017-08-09 18:20:44 -0500180 std::string service = "xyz.openbmc_project.Inventory.Manager";
Brandon Wyman50bb85d2017-11-01 18:36:00 -0500181 util::getProperty(INVENTORY_INTERFACE, PRESENT_PROP, inventoryPath,
182 service, bus, this->present);
Brandon Wyman10295542017-08-09 18:20:44 -0500183}
184
Brandon Wyman431fbe42017-08-18 16:22:09 -0500185void PowerSupply::powerStateChanged(sdbusplus::message::message& msg)
186{
187 int32_t state = 0;
188 std::string msgSensor;
189 std::map<std::string, sdbusplus::message::variant<int32_t, int32_t>>
190 msgData;
191 msg.read(msgSensor, msgData);
192
193 // Check if it was the Present property that changed.
194 auto valPropMap = msgData.find("state");
195 if (valPropMap != msgData.end())
196 {
197 state = sdbusplus::message::variant_ns::get<int32_t>(valPropMap->second);
198
199 // Power is on when state=1. Set the fault logged variables to false
200 // and start the power on timer when the state changes to 1.
201 if (state)
202 {
Brandon Wyman6ccce0b2017-10-26 15:13:10 -0500203 clearFaults();
Brandon Wyman431fbe42017-08-18 16:22:09 -0500204 powerOnTimer.start(powerOnInterval, Timer::TimerType::oneshot);
205 }
206 else
207 {
208 powerOnTimer.stop();
209 powerOn = false;
210 }
211 }
212
213}
214
215void PowerSupply::updatePowerState()
216{
217 // When state = 1, system is powered on
218 int32_t state = 0;
219
220 try
221 {
222 auto service = util::getService(POWER_OBJ_PATH,
223 POWER_INTERFACE,
224 bus);
225
226 // Use getProperty utility function to get power state.
227 util::getProperty<int32_t>(POWER_INTERFACE,
228 "state",
229 POWER_OBJ_PATH,
230 service,
231 bus,
232 state);
233
234 if (state)
235 {
236 powerOn = true;
237 }
238 else
239 {
240 powerOn = false;
241 }
242 }
243 catch (std::exception& e)
244 {
245 log<level::INFO>("Failed to get power state. Assuming it is off.");
246 powerOn = false;
247 }
248
249}
250
Brandon Wyman603cc002017-08-28 18:17:58 -0500251void PowerSupply::checkInputFault(const uint16_t statusWord)
252{
253 using namespace witherspoon::pmbus;
254
255 std::uint8_t statusInput = 0;
256
Brandon Wymand20686a2017-11-01 17:45:23 -0500257 if (!inputFault && ((statusWord & status_word::INPUT_FAULT_WARN) ||
258 (statusWord & status_word::VIN_UV_FAULT)))
Brandon Wyman603cc002017-08-28 18:17:58 -0500259 {
Brandon Wyman3343e822017-11-03 16:54:11 -0500260 faultFound = true;
Brandon Wyman603cc002017-08-28 18:17:58 -0500261 inputFault = true;
262
Brandon Wyman603cc002017-08-28 18:17:58 -0500263 util::NamesValues nv;
264 nv.add("STATUS_WORD", statusWord);
Brandon Wymana1e96342017-09-25 16:47:44 -0500265 captureCmd(nv, STATUS_INPUT, Type::Debug);
Brandon Wyman603cc002017-08-28 18:17:58 -0500266
Brandon Wymane0eb45c2017-10-06 12:58:42 -0500267 using metadata = org::open_power::Witherspoon::Fault::
Brandon Wyman603cc002017-08-28 18:17:58 -0500268 PowerSupplyInputFault;
269
270 report<PowerSupplyInputFault>(
Brandon Wymanea358c92017-10-27 17:34:07 -0500271 metadata::RAW_STATUS(nv.get().c_str()),
272 metadata::CALLOUT_INVENTORY_PATH(inventoryPath.c_str()));
Brandon Wyman603cc002017-08-28 18:17:58 -0500273 }
274 else
275 {
276 if ((inputFault) &&
Brandon Wymand20686a2017-11-01 17:45:23 -0500277 !(statusWord & status_word::INPUT_FAULT_WARN) &&
278 !(statusWord & status_word::VIN_UV_FAULT))
Brandon Wyman603cc002017-08-28 18:17:58 -0500279 {
280 inputFault = false;
Brandon Wyman3343e822017-11-03 16:54:11 -0500281 faultFound = false;
Brandon Wyman69591bd2017-11-01 18:07:23 -0500282
Brandon Wyman603cc002017-08-28 18:17:58 -0500283 statusInput = pmbusIntf.read(STATUS_INPUT, Type::Debug);
284
285 log<level::INFO>("INPUT_FAULT_WARN cleared",
286 entry("POWERSUPPLY=%s", inventoryPath.c_str()),
287 entry("STATUS_WORD=0x%04X", statusWord),
288 entry("STATUS_INPUT=0x%02X", statusInput));
Brandon Wyman69591bd2017-11-01 18:07:23 -0500289
290 if (powerOn)
291 {
292 // The power supply will not be immediately powered on after
293 // the input power is restored.
294 powerOn = false;
295 // Start up the timer that will set the state to indicate we
296 // are ready for the powered on fault checks.
297 powerOnTimer.start(powerOnInterval, Timer::TimerType::oneshot);
298 }
Brandon Wyman603cc002017-08-28 18:17:58 -0500299 }
300 }
301}
302
303void PowerSupply::checkPGOrUnitOffFault(const uint16_t statusWord)
304{
305 using namespace witherspoon::pmbus;
306
Brandon Wyman593d24f2017-10-13 18:15:23 -0500307 if (powerOnFault < FAULT_COUNT)
Brandon Wyman603cc002017-08-28 18:17:58 -0500308 {
Brandon Wyman593d24f2017-10-13 18:15:23 -0500309 // Check PG# and UNIT_IS_OFF
310 if ((statusWord & status_word::POWER_GOOD_NEGATED) ||
311 (statusWord & status_word::UNIT_IS_OFF))
312 {
313 log<level::INFO>("PGOOD or UNIT_IS_OFF bit bad",
314 entry("STATUS_WORD=0x%04X", statusWord));
315 powerOnFault++;
316 }
317 else
318 {
319 if (powerOnFault > 0)
320 {
321 log<level::INFO>("PGOOD and UNIT_IS_OFF bits good");
322 powerOnFault = 0;
323 }
324 }
Brandon Wyman603cc002017-08-28 18:17:58 -0500325
Brandon Wyman593d24f2017-10-13 18:15:23 -0500326 if (powerOnFault >= FAULT_COUNT)
327 {
Brandon Wyman3343e822017-11-03 16:54:11 -0500328 faultFound = true;
329
Brandon Wyman593d24f2017-10-13 18:15:23 -0500330 util::NamesValues nv;
331 nv.add("STATUS_WORD", statusWord);
332 captureCmd(nv, STATUS_INPUT, Type::Debug);
333 auto status0Vout = pmbusIntf.insertPageNum(STATUS_VOUT, 0);
334 captureCmd(nv, status0Vout, Type::Debug);
335 captureCmd(nv, STATUS_IOUT, Type::Debug);
336 captureCmd(nv, STATUS_MFR, Type::Debug);
Brandon Wyman603cc002017-08-28 18:17:58 -0500337
Brandon Wyman593d24f2017-10-13 18:15:23 -0500338 using metadata = org::open_power::Witherspoon::Fault::
339 PowerSupplyShouldBeOn;
Brandon Wyman603cc002017-08-28 18:17:58 -0500340
Brandon Wyman593d24f2017-10-13 18:15:23 -0500341 // A power supply is OFF (or pgood low) but should be on.
342 report<PowerSupplyShouldBeOn>(
343 metadata::RAW_STATUS(nv.get().c_str()),
344 metadata::CALLOUT_INVENTORY_PATH(
345 inventoryPath.c_str()));
346 }
Brandon Wyman603cc002017-08-28 18:17:58 -0500347 }
348
349}
350
351void PowerSupply::checkCurrentOutOverCurrentFault(const uint16_t statusWord)
352{
353 using namespace witherspoon::pmbus;
354
Brandon Wyman603cc002017-08-28 18:17:58 -0500355 // Check for an output overcurrent fault.
356 if ((statusWord & status_word::IOUT_OC_FAULT) &&
357 !outputOCFault)
358 {
Brandon Wyman603cc002017-08-28 18:17:58 -0500359 util::NamesValues nv;
360 nv.add("STATUS_WORD", statusWord);
Brandon Wymana1e96342017-09-25 16:47:44 -0500361 captureCmd(nv, STATUS_INPUT, Type::Debug);
362 auto status0Vout = pmbusIntf.insertPageNum(STATUS_VOUT, 0);
363 captureCmd(nv, status0Vout, Type::Debug);
364 captureCmd(nv, STATUS_IOUT, Type::Debug);
365 captureCmd(nv, STATUS_MFR, Type::Debug);
Brandon Wyman603cc002017-08-28 18:17:58 -0500366
Brandon Wymane0eb45c2017-10-06 12:58:42 -0500367 using metadata = org::open_power::Witherspoon::Fault::
Brandon Wyman603cc002017-08-28 18:17:58 -0500368 PowerSupplyOutputOvercurrent;
369
370 report<PowerSupplyOutputOvercurrent>(metadata::RAW_STATUS(
371 nv.get().c_str()),
372 metadata::CALLOUT_INVENTORY_PATH(
373 inventoryPath.c_str()));
374
Brandon Wyman3343e822017-11-03 16:54:11 -0500375 faultFound = true;
Brandon Wyman603cc002017-08-28 18:17:58 -0500376 outputOCFault = true;
377 }
378}
379
Brandon Wymanab05c072017-08-30 18:26:41 -0500380void PowerSupply::checkOutputOvervoltageFault(const uint16_t statusWord)
381{
382 using namespace witherspoon::pmbus;
383
Brandon Wymanab05c072017-08-30 18:26:41 -0500384 // Check for an output overvoltage fault.
385 if ((statusWord & status_word::VOUT_OV_FAULT) &&
386 !outputOVFault)
387 {
Brandon Wymanab05c072017-08-30 18:26:41 -0500388 util::NamesValues nv;
389 nv.add("STATUS_WORD", statusWord);
Brandon Wymana1e96342017-09-25 16:47:44 -0500390 captureCmd(nv, STATUS_INPUT, Type::Debug);
391 auto status0Vout = pmbusIntf.insertPageNum(STATUS_VOUT, 0);
392 captureCmd(nv, status0Vout, Type::Debug);
393 captureCmd(nv, STATUS_IOUT, Type::Debug);
394 captureCmd(nv, STATUS_MFR, Type::Debug);
Brandon Wymanab05c072017-08-30 18:26:41 -0500395
Brandon Wymane0eb45c2017-10-06 12:58:42 -0500396 using metadata = org::open_power::Witherspoon::Fault::
Brandon Wymanab05c072017-08-30 18:26:41 -0500397 PowerSupplyOutputOvervoltage;
398
399 report<PowerSupplyOutputOvervoltage>(metadata::RAW_STATUS(
400 nv.get().c_str()),
401 metadata::CALLOUT_INVENTORY_PATH(
402 inventoryPath.c_str()));
403
Brandon Wyman3343e822017-11-03 16:54:11 -0500404 faultFound = true;
Brandon Wymanab05c072017-08-30 18:26:41 -0500405 outputOVFault = true;
406 }
407}
408
Brandon Wyman12661f12017-08-31 15:28:21 -0500409void PowerSupply::checkFanFault(const uint16_t statusWord)
410{
411 using namespace witherspoon::pmbus;
412
Brandon Wyman875b3632017-09-13 18:46:03 -0500413 // Check for a fan fault or warning condition
Brandon Wyman12661f12017-08-31 15:28:21 -0500414 if ((statusWord & status_word::FAN_FAULT) &&
415 !fanFault)
416 {
Brandon Wyman12661f12017-08-31 15:28:21 -0500417 util::NamesValues nv;
418 nv.add("STATUS_WORD", statusWord);
Brandon Wymana1e96342017-09-25 16:47:44 -0500419 captureCmd(nv, STATUS_MFR, Type::Debug);
420 captureCmd(nv, STATUS_TEMPERATURE, Type::Debug);
421 captureCmd(nv, STATUS_FANS_1_2, Type::Debug);
Brandon Wyman12661f12017-08-31 15:28:21 -0500422
Brandon Wymane0eb45c2017-10-06 12:58:42 -0500423 using metadata = org::open_power::Witherspoon::Fault::
Brandon Wyman12661f12017-08-31 15:28:21 -0500424 PowerSupplyFanFault;
425
426 report<PowerSupplyFanFault>(
427 metadata::RAW_STATUS(nv.get().c_str()),
428 metadata::CALLOUT_INVENTORY_PATH(inventoryPath.c_str()));
429
Brandon Wyman3343e822017-11-03 16:54:11 -0500430 faultFound = true;
Brandon Wyman12661f12017-08-31 15:28:21 -0500431 fanFault = true;
432 }
433}
434
Brandon Wyman875b3632017-09-13 18:46:03 -0500435void PowerSupply::checkTemperatureFault(const uint16_t statusWord)
436{
437 using namespace witherspoon::pmbus;
438
439 // Due to how the PMBus core device driver sends a clear faults command
440 // the bit in STATUS_WORD will likely be cleared when we attempt to examine
441 // it for a Thermal Fault or Warning. So, check the STATUS_WORD and the
442 // STATUS_TEMPERATURE bits. If either indicates a fault, proceed with
443 // logging the over-temperature condition.
444 std::uint8_t statusTemperature = 0;
445 statusTemperature = pmbusIntf.read(STATUS_TEMPERATURE, Type::Debug);
446 if (((statusWord & status_word::TEMPERATURE_FAULT_WARN) ||
447 (statusTemperature & status_temperature::OT_FAULT)) &&
448 !temperatureFault)
449 {
450 // The power supply has had an over-temperature condition.
451 // This may not result in a shutdown if experienced for a short
452 // duration.
453 // This should not occur under normal conditions.
454 // The power supply may be faulty, or the paired supply may be putting
455 // out less current.
456 // Capture command responses with potentially relevant information,
457 // and call out the power supply reporting the condition.
Brandon Wyman875b3632017-09-13 18:46:03 -0500458 util::NamesValues nv;
459 nv.add("STATUS_WORD", statusWord);
Brandon Wymana1e96342017-09-25 16:47:44 -0500460 captureCmd(nv, STATUS_MFR, Type::Debug);
461 captureCmd(nv, STATUS_IOUT, Type::Debug);
Brandon Wyman875b3632017-09-13 18:46:03 -0500462 nv.add("STATUS_TEMPERATURE", statusTemperature);
Brandon Wymana1e96342017-09-25 16:47:44 -0500463 captureCmd(nv, STATUS_FANS_1_2, Type::Debug);
Brandon Wyman875b3632017-09-13 18:46:03 -0500464
Brandon Wymane0eb45c2017-10-06 12:58:42 -0500465 using metadata = org::open_power::Witherspoon::Fault::
Brandon Wyman875b3632017-09-13 18:46:03 -0500466 PowerSupplyTemperatureFault;
467
468 report<PowerSupplyTemperatureFault>(
469 metadata::RAW_STATUS(nv.get().c_str()),
470 metadata::CALLOUT_INVENTORY_PATH(inventoryPath.c_str()));
471
Brandon Wyman3343e822017-11-03 16:54:11 -0500472 faultFound = true;
Brandon Wyman875b3632017-09-13 18:46:03 -0500473 temperatureFault = true;
474 }
475}
476
Brandon Wyman1db9a9e2017-07-26 18:50:22 -0500477void PowerSupply::clearFaults()
478{
Brandon Wyman6ccce0b2017-10-26 15:13:10 -0500479 readFailLogged = false;
Brandon Wyman6ccce0b2017-10-26 15:13:10 -0500480 inputFault = false;
481 powerOnFault = 0;
482 outputOCFault = false;
483 outputOVFault = false;
484 fanFault = false;
485 temperatureFault = false;
Brandon Wyman3343e822017-11-03 16:54:11 -0500486 faultFound = false;
Brandon Wyman6ccce0b2017-10-26 15:13:10 -0500487
Brandon Wyman1db9a9e2017-07-26 18:50:22 -0500488 return;
489}
490
Brandon Wyman24e422f2017-07-25 19:40:14 -0500491}
492}
493}