proteus fails to start while powered by stim board #5545
only:proteus_f7
This commit is contained in:
parent
291dcc6c1e
commit
720ba01d04
|
@ -290,7 +290,7 @@ class CommunicationBlinkingTask : public PeriodicTimerController {
|
|||
// make sure we do not turn the critical LED off if already have
|
||||
// critical error by now
|
||||
for (uint32_t i = 0; !hasFirmwareError() && i < sizeof(leds) / sizeof(leds[0]); i++) {
|
||||
leds[i]->setValue(value);
|
||||
leds[i]->setValue(value, /*force*/true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -306,7 +306,7 @@ class CommunicationBlinkingTask : public PeriodicTimerController {
|
|||
// second invocation of BlinkingTask
|
||||
setAllLeds(0);
|
||||
} else if (counter % 2 == 0) {
|
||||
enginePins.communicationLedPin.setValue(0);
|
||||
enginePins.communicationLedPin.setValue(0, /*force*/true);
|
||||
#if HW_CHECK_SD
|
||||
extern int totalLoggedBytes;
|
||||
if (totalLoggedBytes > 2000) {
|
||||
|
@ -342,7 +342,7 @@ extern int totalLoggedBytes;
|
|||
offTimeMs = 0.6 * onTimeMs;
|
||||
}
|
||||
|
||||
enginePins.communicationLedPin.setValue(1);
|
||||
enginePins.communicationLedPin.setValue(1, /*force*/true);
|
||||
//#if HW_CHECK_MODE
|
||||
// // we have to do anything possible to help users notice FACTORY MODE
|
||||
// enginePins.errorLedPin.setValue(0);
|
||||
|
|
|
@ -252,7 +252,7 @@ void firmwareError(ObdCode code, const char *fmt, ...) {
|
|||
va_end(ap);
|
||||
#endif
|
||||
criticalShutdown();
|
||||
enginePins.communicationLedPin.setValue(1);
|
||||
enginePins.communicationLedPin.setValue(1, /*force*/true);
|
||||
|
||||
hasFirmwareErrorFlag = true;
|
||||
if (indexOf(fmt, '%') == -1) {
|
||||
|
|
|
@ -492,14 +492,14 @@ void OutputPin::setOnchipValue(int electricalValue) {
|
|||
}
|
||||
#endif // EFI_PROD_CODE
|
||||
|
||||
void OutputPin::setValue(int logicValue) {
|
||||
setValue(nullptr, logicValue);
|
||||
void OutputPin::setValue(int logicValue, bool isForce) {
|
||||
setValue(nullptr, logicValue, isForce);
|
||||
}
|
||||
|
||||
extern bool qcDirectPinControlMode;
|
||||
|
||||
void OutputPin::setValue(const char *msg, int logicValue) {
|
||||
if (qcDirectPinControlMode) {
|
||||
void OutputPin::setValue(const char *msg, int logicValue, bool isForce) {
|
||||
if (qcDirectPinControlMode && !isForce) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -553,7 +553,7 @@ bool OutputPin::getLogicValue() const {
|
|||
void OutputPin::setDefaultPinState(pin_output_mode_e outputMode) {
|
||||
assertOMode(mode);
|
||||
this->mode = outputMode;
|
||||
setValue(false); // initial state
|
||||
setValue(false, /*force*/true); // initial state
|
||||
}
|
||||
|
||||
brain_pin_diag_e OutputPin::getDiag() const {
|
||||
|
|
|
@ -53,8 +53,8 @@ public:
|
|||
bool isInitialized();
|
||||
|
||||
bool getAndSet(int logicValue);
|
||||
void setValue(const char *msg, int logicValue);
|
||||
TEST_VIRTUAL void setValue(int logicValue);
|
||||
void setValue(const char *msg, int logicValue, bool isForce = false);
|
||||
TEST_VIRTUAL void setValue(int logicValue, bool isForce = false);
|
||||
void toggle();
|
||||
bool getLogicValue() const;
|
||||
|
||||
|
|
|
@ -71,7 +71,7 @@ public:
|
|||
MockOutputPin();
|
||||
virtual ~MockOutputPin();
|
||||
|
||||
MOCK_METHOD(void, setValue, (int value), (override));
|
||||
MOCK_METHOD(void, setValue, (int value, bool isForce), (override));
|
||||
};
|
||||
|
||||
class MockExecutor : public TestExecutor {
|
||||
|
|
|
@ -9,7 +9,7 @@ using ::testing::StrictMock;
|
|||
TEST(DcMotor, Disable) {
|
||||
StrictMock<MockOutputPin> dpin;
|
||||
|
||||
EXPECT_CALL(dpin, setValue(1))
|
||||
EXPECT_CALL(dpin, setValue(1, testing::_))
|
||||
.Times(2); // happens twice - once for initial disable, once for set(0)
|
||||
|
||||
TwoPinDcMotor dut(dpin);
|
||||
|
@ -18,7 +18,7 @@ TEST(DcMotor, Disable) {
|
|||
TEST(DcMotor, Disable2) {
|
||||
StrictMock<MockOutputPin> dpin;
|
||||
|
||||
EXPECT_CALL(dpin, setValue(1)).Times(4);
|
||||
EXPECT_CALL(dpin, setValue(1, testing::_)).Times(4);
|
||||
|
||||
TwoPinDcMotor dut(dpin);
|
||||
|
||||
|
@ -32,10 +32,10 @@ TEST(DcMotor, Enable) {
|
|||
InSequence is;
|
||||
|
||||
// Construction disables
|
||||
EXPECT_CALL(dpin, setValue(1)).Times(2);
|
||||
EXPECT_CALL(dpin, setValue(1, testing::_)).Times(2);
|
||||
|
||||
// Then enable
|
||||
EXPECT_CALL(dpin, setValue(0));
|
||||
EXPECT_CALL(dpin, setValue(0, testing::_));
|
||||
}
|
||||
|
||||
TwoPinDcMotor dut(dpin);
|
||||
|
@ -44,7 +44,7 @@ TEST(DcMotor, Enable) {
|
|||
|
||||
TEST(DcMotor, SetUnconfigured) {
|
||||
StrictMock<MockOutputPin> dpin;
|
||||
EXPECT_CALL(dpin, setValue(1)).Times(3);
|
||||
EXPECT_CALL(dpin, setValue(1, testing::_)).Times(3);
|
||||
|
||||
TwoPinDcMotor dut(dpin);
|
||||
EXPECT_FLOAT_EQ(dut.get(), 0);
|
||||
|
|
|
@ -50,14 +50,14 @@ TEST(GpPwm, OutputOnOff) {
|
|||
InSequence i;
|
||||
|
||||
// Rising edge test
|
||||
EXPECT_CALL(pin, setValue(0));
|
||||
EXPECT_CALL(pin, setValue(1));
|
||||
EXPECT_CALL(pin, setValue(1));
|
||||
EXPECT_CALL(pin, setValue(0, false));
|
||||
EXPECT_CALL(pin, setValue(1, false));
|
||||
EXPECT_CALL(pin, setValue(1, false));
|
||||
|
||||
// Falling edge test
|
||||
EXPECT_CALL(pin, setValue(1));
|
||||
EXPECT_CALL(pin, setValue(0));
|
||||
EXPECT_CALL(pin, setValue(0));
|
||||
EXPECT_CALL(pin, setValue(1, false));
|
||||
EXPECT_CALL(pin, setValue(0, false));
|
||||
EXPECT_CALL(pin, setValue(0, false));
|
||||
}
|
||||
|
||||
ch.init(false, nullptr, &pin, nullptr, &cfg);
|
||||
|
|
Loading…
Reference in New Issue