rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
tunerstudio.h
Go to the documentation of this file.
1/**
2 * @file tunerstudio.h
3 *
4 * @date Aug 26, 2013
5 * @author Andrey Belomutskiy, (c) 2012-2020
6 */
7
8#pragma once
9#include "global.h"
10#include "tunerstudio_io.h"
11
12#define TS_PAGE_SETTINGS 0x0000
13// Issue TS zeroes LSB byte of pageIdentifier
14#define TS_PAGE_SCATTER_OFFSETS 0x0100
15#define TS_PAGE_LTFT_TRIMS 0x0200
16
39
41
42void tunerStudioDebug(TsChannelBase* tsChannel, const char *msg);
43void tunerStudioError(TsChannelBase* tsChannel, const char *msg);
44#define DO_NOT_LOG nullptr
45void sendErrorCode(TsChannelBase *tsChannel, uint8_t code, /*empty line by default, use nullptr not to log*/const char *msg="");
46
47void requestBurn();
48
49// Lua script might want to know how long since last TS request to see if unit is being actively monitored
51
52#if EFI_TUNER_STUDIO
53#include "thread_controller.h"
54#include "thread_priority.h"
55
57
58bool isTuningVeNow();
61void onApplyPreset();
62
64 uint16_t offset;
65 uint16_t count;
66} __attribute__((packed));
67static_assert(sizeof(TunerStudioRWChunkRequest) == 4);
68
70 uint16_t page;
71 uint16_t offset;
72 uint16_t count;
73} __attribute__((packed));
74static_assert(sizeof(TunerStudioPageRWChunkRequest) == 6);
75
76#if EFI_PROD_CODE || EFI_SIMULATOR
77#define CONNECTIVITY_THREAD_STACK (3 * UTILITY_THREAD_STACK_SIZE)
78
79class TunerstudioThread : public ThreadController<CONNECTIVITY_THREAD_STACK> {
80public:
81 TunerstudioThread(const char* name)
82 : ThreadController(name, PRIO_CONSOLE)
83 {
84 }
85
86 // Initialize and return the channel to use for this thread.
88
89 void ThreadTask() override;
90
91};
92#endif
93
94bool isTouchingArea(uint16_t offset, uint16_t count, int areaStart, int areaSize);
95
96#endif /* EFI_TUNER_STUDIO */
uint8_t code
Definition bluetooth.cpp:40
A base class for a controller that requires its own thread.
virtual TsChannelBase * setupChannel()=0
TunerstudioThread(const char *name)
Definition tunerstudio.h:81
void ThreadTask() override
This file sets the thread priority for the threads running on rusEFI.
bool isTouchingArea(uint16_t offset, uint16_t count, int areaStart, int areaSize)
bool needToTriggerTsRefresh()
TunerstudioThread __attribute__
tunerstudio_counters_s tsState
void updateTunerStudioState()
void sendErrorCode(TsChannelBase *tsChannel, uint8_t code, const char *msg="")
void requestBurn()
void startTunerStudioConnectivity()
void tunerStudioDebug(TsChannelBase *tsChannel, const char *msg)
uint16_t offset
Definition tunerstudio.h:0
void onApplyPreset()
int getSecondsSinceChannelsRequest()
bool isTuningVeNow()
uint16_t count
Definition tunerstudio.h:1
void tunerStudioError(TsChannelBase *tsChannel, const char *msg)