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 "svnversion.h"
#include "loggingcentral.h"
#include "status_loop.h"
#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) {
tsState.outputChannelsCommandCounter++;
prepareTunerStudioOutputs();
// this method is invoked too often to print any debug information
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
extern fuel_Map3D_t veMap;
@ -599,19 +596,14 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_
}
extern TunerStudioOutputChannels tsOutputChannels;
#endif /* EFI_TUNER_STUDIO */
static void tsStatusThread(Engine *engine) {
chRegSetThreadName("tuner s");
while (true) {
#if EFI_TUNER_STUDIO
// sensor state for EFI Analytics Tuner Studio
updateTunerStudioState(&tsOutputChannels PASS_ENGINE_PARAMETER);
#endif /* EFI_TUNER_STUDIO */
chThdSleepMilliseconds(boardConfiguration->tunerStudioThreadPeriod);
}
void prepareTunerStudioOutputs(void) {
// sensor state for EFI Analytics Tuner Studio
updateTunerStudioState(&tsOutputChannels PASS_ENGINE_PARAMETER);
}
#endif /* EFI_TUNER_STUDIO */
static void subscribe(int outputOrdinal) {
subscription[outputOrdinal] = true;
}
@ -650,7 +642,6 @@ void initStatusLoop(Engine *engine) {
void startStatusThreads(Engine *engine) {
// todo: refactoring needed, this file should probably be split into pieces
chThdCreateStatic(lcdThreadStack, sizeof(lcdThreadStack), NORMALPRIO, (tfunc_t) lcdThread, engine);
chThdCreateStatic(tsThreadStack, sizeof(tsThreadStack), NORMALPRIO, (tfunc_t) tsStatusThread, engine);
#if EFI_PROD_CODE || defined(__DOXYGEN__)
initStatisLeds();
chThdCreateStatic(blinkingStack, sizeof(blinkingStack), NORMALPRIO, (tfunc_t) blinkingThread, NULL);

View File

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