fix mock pins array (#2050)

* fix

* fix probably
This commit is contained in:
Matthew Kennedy 2020-12-09 23:10:58 -06:00 committed by GitHub
parent a08e79789d
commit 5f69d23976
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 11 deletions

View File

@ -15,10 +15,6 @@ EXTERN_ENGINE;
extern LoggingWithStorage sharedLogger;
extern ButtonDebounce startStopButtonDebounce;
#if ! EFI_PROD_CODE
extern bool mockPinStates[(1 << sizeof(brain_pin_e))];
#endif
#if ENABLE_PERF_TRACE
static uint8_t nextThreadId = 0;
void threadInitHook(void* vtp) {

View File

@ -125,7 +125,10 @@ void efiIcuStart(const char *msg, ICUDriver *icup, const ICUConfig *config) {
#endif /* HAL_USE_ICU */
#else
extern bool mockPinStates[(1 << sizeof(brain_pin_e))];
// This has been made global so we don't need to worry about efiReadPin having access the object
// we store it in, every time we need to use efiReadPin.
bool mockPinStates[BRAIN_PIN_COUNT];
bool efiReadPin(brain_pin_e pin) {
return mockPinStates[static_cast<int>(pin)];

View File

@ -29,5 +29,10 @@ EXTERNC iomode_t getInputMode(pin_input_mode_e mode);
#if HAL_USE_ICU
EXTERNC void efiIcuStart(const char *msg, ICUDriver *icup, const ICUConfig *config);
#endif /* HAL_USE_ICU */
#endif /* EFI_GPIO_HARDWARE */
#if ! EFI_PROD_CODE
#define BRAIN_PIN_COUNT (1 << 8 * sizeof(brain_pin_e))
extern bool mockPinStates[BRAIN_PIN_COUNT];
#endif

View File

@ -24,10 +24,6 @@ extern engine_configuration_s & activeConfiguration;
extern bool printTriggerDebug;
extern bool printFuelDebug;
// This has been made global so we don't need to worry about efiReadPin having access the object
// we store it in, every time we need to use efiReadPin.
bool mockPinStates[BRAIN_PIN_COUNT];
EngineTestHelperBase::EngineTestHelperBase() {
// todo: make this not a global variable, we need currentTimeProvider interface on engine
timeNowUs = 0;

View File

@ -7,8 +7,6 @@
#pragma once
#define BRAIN_PIN_COUNT (1 << sizeof(brain_pin_e))
#include "engine.h"
#include "trigger_central.h"
#include "rpm_calculator.h"