auto-sync

This commit is contained in:
rusEfi 2016-01-11 19:02:19 -05:00
parent 14d5a20f88
commit 1972f1c020
17 changed files with 38 additions and 38 deletions

View File

@ -107,7 +107,7 @@ ts_channel_s tsChannel;
extern uint8_t crcWriteBuffer[300]; 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 EFI_PROD_CODE
if (isSerialOverUart() ^ isConsoleRedirect) { if (isSerialOverUart() ^ isConsoleRedirect) {
// TS uses USB when console uses serial // TS uses USB when console uses serial
@ -413,7 +413,7 @@ static bool isKnownCommand(char command) {
static uint8_t firstByte; static uint8_t firstByte;
static uint8_t secondByte; static uint8_t secondByte;
void runBinaryProtocolLoop(ts_channel_s *tsChannel, bool_t isConsoleRedirect) { void runBinaryProtocolLoop(ts_channel_s *tsChannel, bool isConsoleRedirect) {
int wasReady = false; int wasReady = false;
while (true) { while (true) {
int isReady = ts_serial_ready(isConsoleRedirect); int isReady = ts_serial_ready(isConsoleRedirect);

View File

@ -54,7 +54,7 @@ void requestBurn(void);
void startTunerStudioConnectivity(void); void startTunerStudioConnectivity(void);
void syncTunerStudioCopy(void); void syncTunerStudioCopy(void);
void runBinaryProtocolLoop(ts_channel_s *tsChannel, bool_t isConsoleRedirect); void runBinaryProtocolLoop(ts_channel_s *tsChannel, bool isConsoleRedirect);
#if defined __GNUC__ #if defined __GNUC__
// GCC // GCC

View File

@ -159,7 +159,7 @@ bool isConsoleReady(void) {
} }
#endif /* EFI_PROD_CODE || EFI_EGT */ #endif /* EFI_PROD_CODE || EFI_EGT */
bool_t consoleInBinaryMode = false; bool consoleInBinaryMode = false;
ts_channel_s binaryConsole; ts_channel_s binaryConsole;

View File

@ -58,7 +58,7 @@
#include "settings.h" #include "settings.h"
#include "rusefi_outputs.h" #include "rusefi_outputs.h"
extern bool_t main_loop_started; extern bool main_loop_started;
#if EFI_PROD_CODE || defined(__DOXYGEN__) #if EFI_PROD_CODE || defined(__DOXYGEN__)
// todo: move this logic to algo folder! // todo: move this logic to algo folder!
@ -73,7 +73,7 @@ extern bool_t main_loop_started;
extern engine_pins_s enginePins; 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 // this 'true' value is needed for simulator
static volatile bool fullLog = true; static volatile bool fullLog = true;
@ -497,8 +497,8 @@ static void setBlinkingPeriod(int value) {
extern efitick_t lastDecodingErrorTime; extern efitick_t lastDecodingErrorTime;
static bool_t isTriggerErrorNow() { static bool isTriggerErrorNow() {
bool_t justHadError = (getTimeNowNt() - lastDecodingErrorTime) < US2NT(2 * 1000 * 3 * blinkingPeriod); bool justHadError = (getTimeNowNt() - lastDecodingErrorTime) < US2NT(2 * 1000 * 3 * blinkingPeriod);
return justHadError || isTriggerDecoderError(); return justHadError || isTriggerDecoderError();
} }

View File

@ -90,7 +90,7 @@ void WaveChart::resetWaveChart() {
static char WAVE_LOGGING_BUFFER[WAVE_LOGGING_SIZE] CCM_OPTIONAL; 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. * Say at 300rpm we should get at least four events per revolution.
* That's 300/60*4=20 events per second * 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; return startTimeNt != 0 && NT2US(chartDurationNt) > engineConfiguration->engineChartSize * 1000000 / 20;
} }
bool_t WaveChart::isWaveChartFull() { bool WaveChart::isWaveChartFull() {
return counter >= engineConfiguration->engineChartSize; return counter >= engineConfiguration->engineChartSize;
} }

View File

@ -23,8 +23,8 @@ public:
void init(); void init();
void publishChart(); void publishChart();
void resetWaveChart(); void resetWaveChart();
bool_t isWaveChartFull(); bool isWaveChartFull();
bool_t isStartedTooLongAgo(); bool isStartedTooLongAgo();
void publishChartIfFull(); void publishChartIfFull();
void addWaveChartEvent3(const char *name, const char *msg); void addWaveChartEvent3(const char *name, const char *msg);
private: private:

View File

@ -24,7 +24,7 @@
#include "main.h" #include "main.h"
#if EFI_PERF_METRICS #if EFI_PERF_METRICS || defined(__DOXYGEN__)
#include "test.h" #include "test.h"
#include "testbmk.h" #include "testbmk.h"
@ -37,7 +37,7 @@ static ROMCONST struct testcase * ROMCONST *patterns[] = {
NULL NULL
}; };
static bool_t local_fail, global_fail; static bool local_fail, global_fail;
static unsigned failpoint; static unsigned failpoint;
static char tokens_buffer[MAX_TOKENS]; static char tokens_buffer[MAX_TOKENS];
static char *tokp; static char *tokp;
@ -51,7 +51,7 @@ union test_buffers test;
/* /*
* Pointers to the spawned threads. * Pointers to the spawned threads.
*/ */
Thread *threads[MAX_THREADS]; thread_t *threads[MAX_THREADS];
/* /*
* Pointers to the working areas. * Pointers to the working areas.
@ -135,7 +135,7 @@ void test_emit_token(char token) {
/* /*
* Assertions. * Assertions.
*/ */
bool_t _test_fail(unsigned point) { bool _test_fail(unsigned point) {
local_fail = TRUE; local_fail = TRUE;
global_fail = TRUE; global_fail = TRUE;
@ -143,14 +143,14 @@ bool_t _test_fail(unsigned point) {
return TRUE; return TRUE;
} }
bool_t _test_assert(unsigned point, bool_t condition) { bool _test_assert(unsigned point, bool condition) {
if (!condition) if (!condition)
return _test_fail(point); return _test_fail(point);
return FALSE; return FALSE;
} }
bool_t _test_assert_sequence(unsigned point, char *expected) { bool _test_assert_sequence(unsigned point, char *expected) {
char *cp = tokens_buffer; char *cp = tokens_buffer;
while (cp < tokp) { while (cp < tokp) {
if (*cp++ != *expected++) if (*cp++ != *expected++)
@ -162,7 +162,7 @@ bool_t _test_assert_sequence(unsigned point, char *expected) {
return FALSE; 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)); 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. * @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 VirtualTimer vt;
static void tmr(void *p) { static void tmr(void *p) {

View File

@ -84,10 +84,10 @@ extern "C" {
void test_print(const char *msgp); void test_print(const char *msgp);
void test_println(const char *msgp); void test_println(const char *msgp);
void test_emit_token(char token); void test_emit_token(char token);
bool_t _test_fail(unsigned point); bool _test_fail(unsigned point);
bool_t _test_assert(unsigned point, bool_t condition); bool _test_assert(unsigned point, bool condition);
bool_t _test_assert_sequence(unsigned point, char *expected); bool _test_assert_sequence(unsigned point, char *expected);
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);
void test_terminate_threads(void); void test_terminate_threads(void);
void test_wait_threads(void); void test_wait_threads(void);
systime_t test_wait_tick(void); systime_t test_wait_tick(void);
@ -165,7 +165,7 @@ extern "C" {
extern Thread *threads[MAX_THREADS]; extern Thread *threads[MAX_THREADS];
extern union test_buffers test; extern union test_buffers test;
extern void * ROMCONST wa[]; extern void * ROMCONST wa[];
extern bool_t test_timer_done; extern bool test_timer_done;
#endif #endif
#endif /* _TEST_H_ */ #endif /* _TEST_H_ */

View File

@ -329,7 +329,7 @@ void hipAdcCallback(adcsample_t value) {
} }
} }
} }
static bool_t needToInit = true; static bool needToInit = true;
static void hipStartupCode(void) { static void hipStartupCode(void) {
// D[4:1] = 0000 : 4 MHz // D[4:1] = 0000 : 4 MHz

View File

@ -49,7 +49,7 @@ typedef struct {
#define adcToVoltsDivided(adc) (adcToVolts(adc) * engineConfiguration->analogInputDividerCoefficient) #define adcToVoltsDivided(adc) (adcToVolts(adc) * engineConfiguration->analogInputDividerCoefficient)
#else #else
#define getAdcValue(channel) 0 #define getAdcValue(msg, channel) 0
#endif /* HAL_USE_ADC */ #endif /* HAL_USE_ADC */
#endif /* ADC_INPUTS_H_ */ #endif /* ADC_INPUTS_H_ */

View File

@ -16,8 +16,8 @@
typedef struct { typedef struct {
ICUDriver *driver; ICUDriver *driver;
bool_t isActiveHigh; // false for ICU_INPUT_ACTIVE_LOW, true for ICU_INPUT_ACTIVE_HIGH bool isActiveHigh; // false for ICU_INPUT_ACTIVE_LOW, true for ICU_INPUT_ACTIVE_HIGH
volatile bool_t started; volatile bool started;
// todo: make this a template & reduce number of listeners? // todo: make this a template & reduce number of listeners?
// todo: would one listener be enough? // todo: would one listener be enough?

View File

@ -30,7 +30,7 @@ static msg_t stThread(StepperMotor *motor) {
chThdSleepMilliseconds(ST_DELAY_MS); chThdSleepMilliseconds(ST_DELAY_MS);
continue; continue;
} }
bool_t isIncrementing = targetPosition > currentPosition; bool isIncrementing = targetPosition > currentPosition;
palWritePad(motor->directionPort, motor->directionPin, isIncrementing); palWritePad(motor->directionPort, motor->directionPin, isIncrementing);
if (isIncrementing) { if (isIncrementing) {
motor->currentPosition++; motor->currentPosition++;

View File

@ -74,10 +74,10 @@ static ICUDriver *turnOnTriggerInputPin(brain_pin_e hwPin) {
// todo: reuse 'setWaveReaderMode' method here? // todo: reuse 'setWaveReaderMode' method here?
if (driver != NULL) { if (driver != NULL) {
// todo: once http://forum.chibios.org/phpbb/viewtopic.php?f=16&t=1757 is fixed // 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; // 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; // shaft_icucfg.period_cb = needPeriodCallback ? shaft_icu_period_callback : NULL;
efiIcuStart(driver, &shaft_icucfg); efiIcuStart(driver, &shaft_icucfg);

View File

@ -119,7 +119,7 @@
static LoggingWithStorage sharedLogger("main"); static LoggingWithStorage sharedLogger("main");
bool_t main_loop_started = false; bool main_loop_started = false;
static MemoryStream firmwareErrorMessageStream; static MemoryStream firmwareErrorMessageStream;
static char panicMessage[200]; static char panicMessage[200];

View File

@ -44,12 +44,12 @@
static MemoryStream intermediateLoggingBuffer; static MemoryStream intermediateLoggingBuffer;
static uint8_t intermediateLoggingBufferData[INTERMEDIATE_LOGGING_BUFFER_SIZE] CCM_OPTIONAL; static uint8_t intermediateLoggingBufferData[INTERMEDIATE_LOGGING_BUFFER_SIZE] CCM_OPTIONAL;
//todo define max-printf-buffer //todo define max-printf-buffer
static bool_t intermediateLoggingBufferInited = false; static bool intermediateLoggingBufferInited = false;
/** /**
* @returns true if data does not fit into this buffer * @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) { if (logging->buffer == NULL) {
firmwareError("Logging not initialized: %s", logging->name); firmwareError("Logging not initialized: %s", logging->name);
return true; return true;
@ -67,7 +67,7 @@ static INLINE bool_t validateBuffer(Logging *logging, uint32_t extraLen) {
void append(Logging *logging, const char *text) { void append(Logging *logging, const char *text) {
efiAssertVoid(text != NULL, "append NULL"); efiAssertVoid(text != NULL, "append NULL");
uint32_t extraLen = efiStrlen(text); uint32_t extraLen = efiStrlen(text);
bool_t isError = validateBuffer(logging, extraLen); bool isError = validateBuffer(logging, extraLen);
if (isError) { if (isError) {
return; return;
} }

View File

@ -35,7 +35,7 @@ public:
*/ */
char *linePointer; char *linePointer;
int bufferSize; int bufferSize;
volatile bool_t isInitialized; volatile bool isInitialized;
}; };
class LoggingWithStorage : public Logging { class LoggingWithStorage : public Logging {

View File

@ -94,7 +94,7 @@ char * swapOutputBuffers(int *actualOutputBufferSize) {
return outputBuffer; return outputBuffer;
} }
extern bool_t consoleInBinaryMode; extern bool consoleInBinaryMode;
/** /**
* This method actually sends all the pending data to the communication layer. * This method actually sends all the pending data to the communication layer.