auto-sync

This commit is contained in:
rusEfi 2015-03-15 13:05:21 -05:00
parent a7c40d9539
commit 6dfaaf1c5b
3 changed files with 8 additions and 14 deletions

View File

@ -80,6 +80,7 @@
#include "engine_configuration.h" #include "engine_configuration.h"
#include "svnversion.h" #include "svnversion.h"
#include "loggingcentral.h" #include "loggingcentral.h"
#include "status_loop.h"
#if EFI_TUNER_STUDIO || defined(__DOXYGEN__) #if EFI_TUNER_STUDIO || defined(__DOXYGEN__)
@ -551,6 +552,7 @@ void handleQueryCommand(ts_channel_s *tsChannel, ts_response_format_e mode) {
*/ */
void handleOutputChannelsCommand(ts_channel_s *tsChannel, ts_response_format_e mode) { void handleOutputChannelsCommand(ts_channel_s *tsChannel, ts_response_format_e mode) {
tsState.outputChannelsCommandCounter++; tsState.outputChannelsCommandCounter++;
prepareTunerStudioOutputs();
// this method is invoked too often to print any debug information // this method is invoked too often to print any debug information
tsSendResponse(tsChannel, mode, (const uint8_t *) &tsOutputChannels, sizeof(TunerStudioOutputChannels)); tsSendResponse(tsChannel, mode, (const uint8_t *) &tsOutputChannels, sizeof(TunerStudioOutputChannels));
} }

View File

@ -514,9 +514,6 @@ static void lcdThread(void *arg) {
} }
} }
// stack for Tuner Studio thread
static THD_WORKING_AREA(tsThreadStack, UTILITY_THREAD_STACK_SIZE);
#if EFI_TUNER_STUDIO #if EFI_TUNER_STUDIO
extern fuel_Map3D_t veMap; extern fuel_Map3D_t veMap;
@ -599,19 +596,14 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_
} }
extern TunerStudioOutputChannels tsOutputChannels; extern TunerStudioOutputChannels tsOutputChannels;
#endif /* EFI_TUNER_STUDIO */
static void tsStatusThread(Engine *engine) { void prepareTunerStudioOutputs(void) {
chRegSetThreadName("tuner s"); // sensor state for EFI Analytics Tuner Studio
while (true) { updateTunerStudioState(&tsOutputChannels PASS_ENGINE_PARAMETER);
#if EFI_TUNER_STUDIO
// sensor state for EFI Analytics Tuner Studio
updateTunerStudioState(&tsOutputChannels PASS_ENGINE_PARAMETER);
#endif /* EFI_TUNER_STUDIO */
chThdSleepMilliseconds(boardConfiguration->tunerStudioThreadPeriod);
}
} }
#endif /* EFI_TUNER_STUDIO */
static void subscribe(int outputOrdinal) { static void subscribe(int outputOrdinal) {
subscription[outputOrdinal] = true; subscription[outputOrdinal] = true;
} }
@ -650,7 +642,6 @@ void initStatusLoop(Engine *engine) {
void startStatusThreads(Engine *engine) { void startStatusThreads(Engine *engine) {
// todo: refactoring needed, this file should probably be split into pieces // todo: refactoring needed, this file should probably be split into pieces
chThdCreateStatic(lcdThreadStack, sizeof(lcdThreadStack), NORMALPRIO, (tfunc_t) lcdThread, engine); chThdCreateStatic(lcdThreadStack, sizeof(lcdThreadStack), NORMALPRIO, (tfunc_t) lcdThread, engine);
chThdCreateStatic(tsThreadStack, sizeof(tsThreadStack), NORMALPRIO, (tfunc_t) tsStatusThread, engine);
#if EFI_PROD_CODE || defined(__DOXYGEN__) #if EFI_PROD_CODE || defined(__DOXYGEN__)
initStatisLeds(); initStatisLeds();
chThdCreateStatic(blinkingStack, sizeof(blinkingStack), NORMALPRIO, (tfunc_t) blinkingThread, NULL); chThdCreateStatic(blinkingStack, sizeof(blinkingStack), NORMALPRIO, (tfunc_t) blinkingThread, NULL);

View File

@ -12,6 +12,7 @@
void updateDevConsoleState(Engine *engine); void updateDevConsoleState(Engine *engine);
void printSensors(void); void printSensors(void);
void prepareTunerStudioOutputs(void);
void startStatusThreads(Engine *engine); void startStatusThreads(Engine *engine);
void initStatusLoop(Engine *engine); void initStatusLoop(Engine *engine);
void writeLogLine(void); void writeLogLine(void);