auto-sync
This commit is contained in:
parent
14d5a20f88
commit
1972f1c020
|
@ -107,7 +107,7 @@ ts_channel_s tsChannel;
|
|||
|
||||
extern uint8_t crcWriteBuffer[300];
|
||||
|
||||
static int ts_serial_ready(bool_t isConsoleRedirect) {
|
||||
static int ts_serial_ready(bool isConsoleRedirect) {
|
||||
#if EFI_PROD_CODE
|
||||
if (isSerialOverUart() ^ isConsoleRedirect) {
|
||||
// TS uses USB when console uses serial
|
||||
|
@ -413,7 +413,7 @@ static bool isKnownCommand(char command) {
|
|||
static uint8_t firstByte;
|
||||
static uint8_t secondByte;
|
||||
|
||||
void runBinaryProtocolLoop(ts_channel_s *tsChannel, bool_t isConsoleRedirect) {
|
||||
void runBinaryProtocolLoop(ts_channel_s *tsChannel, bool isConsoleRedirect) {
|
||||
int wasReady = false;
|
||||
while (true) {
|
||||
int isReady = ts_serial_ready(isConsoleRedirect);
|
||||
|
|
|
@ -54,7 +54,7 @@ void requestBurn(void);
|
|||
|
||||
void startTunerStudioConnectivity(void);
|
||||
void syncTunerStudioCopy(void);
|
||||
void runBinaryProtocolLoop(ts_channel_s *tsChannel, bool_t isConsoleRedirect);
|
||||
void runBinaryProtocolLoop(ts_channel_s *tsChannel, bool isConsoleRedirect);
|
||||
|
||||
#if defined __GNUC__
|
||||
// GCC
|
||||
|
|
|
@ -159,7 +159,7 @@ bool isConsoleReady(void) {
|
|||
}
|
||||
#endif /* EFI_PROD_CODE || EFI_EGT */
|
||||
|
||||
bool_t consoleInBinaryMode = false;
|
||||
bool consoleInBinaryMode = false;
|
||||
|
||||
ts_channel_s binaryConsole;
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
#include "settings.h"
|
||||
#include "rusefi_outputs.h"
|
||||
|
||||
extern bool_t main_loop_started;
|
||||
extern bool main_loop_started;
|
||||
|
||||
#if EFI_PROD_CODE || defined(__DOXYGEN__)
|
||||
// todo: move this logic to algo folder!
|
||||
|
@ -73,7 +73,7 @@ extern bool_t main_loop_started;
|
|||
|
||||
extern engine_pins_s enginePins;
|
||||
|
||||
static bool_t subscription[(int) RO_LAST_ELEMENT];
|
||||
static bool subscription[(int) RO_LAST_ELEMENT];
|
||||
|
||||
// this 'true' value is needed for simulator
|
||||
static volatile bool fullLog = true;
|
||||
|
@ -497,8 +497,8 @@ static void setBlinkingPeriod(int value) {
|
|||
|
||||
extern efitick_t lastDecodingErrorTime;
|
||||
|
||||
static bool_t isTriggerErrorNow() {
|
||||
bool_t justHadError = (getTimeNowNt() - lastDecodingErrorTime) < US2NT(2 * 1000 * 3 * blinkingPeriod);
|
||||
static bool isTriggerErrorNow() {
|
||||
bool justHadError = (getTimeNowNt() - lastDecodingErrorTime) < US2NT(2 * 1000 * 3 * blinkingPeriod);
|
||||
return justHadError || isTriggerDecoderError();
|
||||
}
|
||||
|
||||
|
|
|
@ -90,7 +90,7 @@ void WaveChart::resetWaveChart() {
|
|||
|
||||
static char WAVE_LOGGING_BUFFER[WAVE_LOGGING_SIZE] CCM_OPTIONAL;
|
||||
|
||||
bool_t WaveChart::isStartedTooLongAgo() {
|
||||
bool WaveChart::isStartedTooLongAgo() {
|
||||
/**
|
||||
* Say at 300rpm we should get at least four events per revolution.
|
||||
* That's 300/60*4=20 events per second
|
||||
|
@ -101,7 +101,7 @@ bool_t WaveChart::isStartedTooLongAgo() {
|
|||
return startTimeNt != 0 && NT2US(chartDurationNt) > engineConfiguration->engineChartSize * 1000000 / 20;
|
||||
}
|
||||
|
||||
bool_t WaveChart::isWaveChartFull() {
|
||||
bool WaveChart::isWaveChartFull() {
|
||||
return counter >= engineConfiguration->engineChartSize;
|
||||
}
|
||||
|
||||
|
|
|
@ -23,8 +23,8 @@ public:
|
|||
void init();
|
||||
void publishChart();
|
||||
void resetWaveChart();
|
||||
bool_t isWaveChartFull();
|
||||
bool_t isStartedTooLongAgo();
|
||||
bool isWaveChartFull();
|
||||
bool isStartedTooLongAgo();
|
||||
void publishChartIfFull();
|
||||
void addWaveChartEvent3(const char *name, const char *msg);
|
||||
private:
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
#include "main.h"
|
||||
|
||||
#if EFI_PERF_METRICS
|
||||
#if EFI_PERF_METRICS || defined(__DOXYGEN__)
|
||||
|
||||
#include "test.h"
|
||||
#include "testbmk.h"
|
||||
|
@ -37,7 +37,7 @@ static ROMCONST struct testcase * ROMCONST *patterns[] = {
|
|||
NULL
|
||||
};
|
||||
|
||||
static bool_t local_fail, global_fail;
|
||||
static bool local_fail, global_fail;
|
||||
static unsigned failpoint;
|
||||
static char tokens_buffer[MAX_TOKENS];
|
||||
static char *tokp;
|
||||
|
@ -51,7 +51,7 @@ union test_buffers test;
|
|||
/*
|
||||
* Pointers to the spawned threads.
|
||||
*/
|
||||
Thread *threads[MAX_THREADS];
|
||||
thread_t *threads[MAX_THREADS];
|
||||
|
||||
/*
|
||||
* Pointers to the working areas.
|
||||
|
@ -135,7 +135,7 @@ void test_emit_token(char token) {
|
|||
/*
|
||||
* Assertions.
|
||||
*/
|
||||
bool_t _test_fail(unsigned point) {
|
||||
bool _test_fail(unsigned point) {
|
||||
|
||||
local_fail = TRUE;
|
||||
global_fail = TRUE;
|
||||
|
@ -143,14 +143,14 @@ bool_t _test_fail(unsigned point) {
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
bool_t _test_assert(unsigned point, bool_t condition) {
|
||||
bool _test_assert(unsigned point, bool condition) {
|
||||
|
||||
if (!condition)
|
||||
return _test_fail(point);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool_t _test_assert_sequence(unsigned point, char *expected) {
|
||||
bool _test_assert_sequence(unsigned point, char *expected) {
|
||||
char *cp = tokens_buffer;
|
||||
while (cp < tokp) {
|
||||
if (*cp++ != *expected++)
|
||||
|
@ -162,7 +162,7 @@ bool_t _test_assert_sequence(unsigned point, char *expected) {
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
bool_t _test_assert_time_window(unsigned point, systime_t start, systime_t end) {
|
||||
bool _test_assert_time_window(unsigned point, systime_t start, systime_t end) {
|
||||
|
||||
return _test_assert(point, chTimeIsWithin(start, end));
|
||||
}
|
||||
|
@ -236,7 +236,7 @@ systime_t test_wait_tick(void) {
|
|||
/**
|
||||
* @brief Set to @p TRUE when the test timer reaches its deadline.
|
||||
*/
|
||||
bool_t test_timer_done;
|
||||
bool test_timer_done;
|
||||
|
||||
static VirtualTimer vt;
|
||||
static void tmr(void *p) {
|
||||
|
|
|
@ -84,10 +84,10 @@ extern "C" {
|
|||
void test_print(const char *msgp);
|
||||
void test_println(const char *msgp);
|
||||
void test_emit_token(char token);
|
||||
bool_t _test_fail(unsigned point);
|
||||
bool_t _test_assert(unsigned point, bool_t condition);
|
||||
bool_t _test_assert_sequence(unsigned point, char *expected);
|
||||
bool_t _test_assert_time_window(unsigned point, systime_t start, systime_t end);
|
||||
bool _test_fail(unsigned point);
|
||||
bool _test_assert(unsigned point, bool condition);
|
||||
bool _test_assert_sequence(unsigned point, char *expected);
|
||||
bool _test_assert_time_window(unsigned point, systime_t start, systime_t end);
|
||||
void test_terminate_threads(void);
|
||||
void test_wait_threads(void);
|
||||
systime_t test_wait_tick(void);
|
||||
|
@ -165,7 +165,7 @@ extern "C" {
|
|||
extern Thread *threads[MAX_THREADS];
|
||||
extern union test_buffers test;
|
||||
extern void * ROMCONST wa[];
|
||||
extern bool_t test_timer_done;
|
||||
extern bool test_timer_done;
|
||||
#endif
|
||||
|
||||
#endif /* _TEST_H_ */
|
||||
|
|
|
@ -329,7 +329,7 @@ void hipAdcCallback(adcsample_t value) {
|
|||
}
|
||||
}
|
||||
}
|
||||
static bool_t needToInit = true;
|
||||
static bool needToInit = true;
|
||||
|
||||
static void hipStartupCode(void) {
|
||||
// D[4:1] = 0000 : 4 MHz
|
||||
|
|
|
@ -49,7 +49,7 @@ typedef struct {
|
|||
#define adcToVoltsDivided(adc) (adcToVolts(adc) * engineConfiguration->analogInputDividerCoefficient)
|
||||
|
||||
#else
|
||||
#define getAdcValue(channel) 0
|
||||
#define getAdcValue(msg, channel) 0
|
||||
#endif /* HAL_USE_ADC */
|
||||
|
||||
#endif /* ADC_INPUTS_H_ */
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
|
||||
typedef struct {
|
||||
ICUDriver *driver;
|
||||
bool_t isActiveHigh; // false for ICU_INPUT_ACTIVE_LOW, true for ICU_INPUT_ACTIVE_HIGH
|
||||
volatile bool_t started;
|
||||
bool isActiveHigh; // false for ICU_INPUT_ACTIVE_LOW, true for ICU_INPUT_ACTIVE_HIGH
|
||||
volatile bool started;
|
||||
|
||||
// todo: make this a template & reduce number of listeners?
|
||||
// todo: would one listener be enough?
|
||||
|
|
|
@ -30,7 +30,7 @@ static msg_t stThread(StepperMotor *motor) {
|
|||
chThdSleepMilliseconds(ST_DELAY_MS);
|
||||
continue;
|
||||
}
|
||||
bool_t isIncrementing = targetPosition > currentPosition;
|
||||
bool isIncrementing = targetPosition > currentPosition;
|
||||
palWritePad(motor->directionPort, motor->directionPin, isIncrementing);
|
||||
if (isIncrementing) {
|
||||
motor->currentPosition++;
|
||||
|
|
|
@ -74,10 +74,10 @@ static ICUDriver *turnOnTriggerInputPin(brain_pin_e hwPin) {
|
|||
// todo: reuse 'setWaveReaderMode' method here?
|
||||
if (driver != NULL) {
|
||||
// todo: once http://forum.chibios.org/phpbb/viewtopic.php?f=16&t=1757 is fixed
|
||||
// bool_t needWidthCallback = !CONFIG(useOnlyFrontForTrigger) || TRIGGER_SHAPE(useRiseEdge);
|
||||
// bool needWidthCallback = !CONFIG(useOnlyFrontForTrigger) || TRIGGER_SHAPE(useRiseEdge);
|
||||
// shaft_icucfg.width_cb = needWidthCallback ? shaft_icu_width_callback : NULL;
|
||||
|
||||
// bool_t needPeriodCallback = !CONFIG(useOnlyFrontForTrigger) || !TRIGGER_SHAPE(useRiseEdge);
|
||||
// bool needPeriodCallback = !CONFIG(useOnlyFrontForTrigger) || !TRIGGER_SHAPE(useRiseEdge);
|
||||
// shaft_icucfg.period_cb = needPeriodCallback ? shaft_icu_period_callback : NULL;
|
||||
|
||||
efiIcuStart(driver, &shaft_icucfg);
|
||||
|
|
|
@ -119,7 +119,7 @@
|
|||
|
||||
static LoggingWithStorage sharedLogger("main");
|
||||
|
||||
bool_t main_loop_started = false;
|
||||
bool main_loop_started = false;
|
||||
|
||||
static MemoryStream firmwareErrorMessageStream;
|
||||
static char panicMessage[200];
|
||||
|
|
|
@ -44,12 +44,12 @@
|
|||
static MemoryStream intermediateLoggingBuffer;
|
||||
static uint8_t intermediateLoggingBufferData[INTERMEDIATE_LOGGING_BUFFER_SIZE] CCM_OPTIONAL;
|
||||
//todo define max-printf-buffer
|
||||
static bool_t intermediateLoggingBufferInited = false;
|
||||
static bool intermediateLoggingBufferInited = false;
|
||||
|
||||
/**
|
||||
* @returns true if data does not fit into this buffer
|
||||
*/
|
||||
static INLINE bool_t validateBuffer(Logging *logging, uint32_t extraLen) {
|
||||
static INLINE bool validateBuffer(Logging *logging, uint32_t extraLen) {
|
||||
if (logging->buffer == NULL) {
|
||||
firmwareError("Logging not initialized: %s", logging->name);
|
||||
return true;
|
||||
|
@ -67,7 +67,7 @@ static INLINE bool_t validateBuffer(Logging *logging, uint32_t extraLen) {
|
|||
void append(Logging *logging, const char *text) {
|
||||
efiAssertVoid(text != NULL, "append NULL");
|
||||
uint32_t extraLen = efiStrlen(text);
|
||||
bool_t isError = validateBuffer(logging, extraLen);
|
||||
bool isError = validateBuffer(logging, extraLen);
|
||||
if (isError) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ public:
|
|||
*/
|
||||
char *linePointer;
|
||||
int bufferSize;
|
||||
volatile bool_t isInitialized;
|
||||
volatile bool isInitialized;
|
||||
};
|
||||
|
||||
class LoggingWithStorage : public Logging {
|
||||
|
|
|
@ -94,7 +94,7 @@ char * swapOutputBuffers(int *actualOutputBufferSize) {
|
|||
return outputBuffer;
|
||||
}
|
||||
|
||||
extern bool_t consoleInBinaryMode;
|
||||
extern bool consoleInBinaryMode;
|
||||
|
||||
/**
|
||||
* This method actually sends all the pending data to the communication layer.
|
||||
|
|
Loading…
Reference in New Issue