Line |
Branch |
Decision |
Exec |
Source |
1 |
|
|
|
#include "pch.h" |
2 |
|
|
|
|
3 |
|
|
|
#include "tunerstudio_impl.h" |
4 |
|
|
|
#include "tunerstudio.h" |
5 |
|
|
|
#include "tunerstudio_io.h" |
6 |
|
|
|
|
7 |
|
|
|
#include "live_data.h" |
8 |
|
|
|
|
9 |
|
|
|
#include "status_loop.h" |
10 |
|
|
|
|
11 |
|
|
|
#if EFI_TUNER_STUDIO |
12 |
|
|
|
|
13 |
|
|
|
static Timer channelsRequestTimer; |
14 |
|
|
|
|
15 |
|
|
✗ |
int getSecondsSinceChannelsRequest() { |
16 |
|
|
✗ |
return channelsRequestTimer.getElapsedSeconds(); |
17 |
|
|
|
} |
18 |
|
|
|
|
19 |
|
|
|
/** |
20 |
|
|
|
* @brief 'Output' command sends out a snapshot of current values |
21 |
|
|
|
* Gauges refresh |
22 |
|
|
|
*/ |
23 |
|
|
✗ |
void TunerStudio::cmdOutputChannels(TsChannelBase* tsChannel, uint16_t offset, uint16_t count) { |
24 |
|
|
✗ |
if (offset + count > TS_TOTAL_OUTPUT_SIZE) { |
25 |
|
|
✗ |
efiPrintf("TS: Version Mismatch? Too much outputs requested offset=%d + count=%d/total=%d", offset, count, |
26 |
|
|
|
TS_TOTAL_OUTPUT_SIZE); |
27 |
|
|
✗ |
sendErrorCode(tsChannel, TS_RESPONSE_OUT_OF_RANGE, "cmd_size"); |
28 |
|
|
✗ |
return; |
29 |
|
|
|
} |
30 |
|
|
|
|
31 |
|
|
✗ |
if (offset < BLOCKING_FACTOR) { |
32 |
|
|
✗ |
engine->outputChannels.outputRequestPeriod = channelsRequestTimer.getElapsedUs(); |
33 |
|
|
✗ |
channelsRequestTimer.reset(); |
34 |
|
|
|
} |
35 |
|
|
|
|
36 |
|
|
✗ |
tsState.outputChannelsCommandCounter++; |
37 |
|
|
✗ |
updateTunerStudioState(); |
38 |
|
|
✗ |
tsChannel->assertPacketSize(count, false); |
39 |
|
|
|
// this method is invoked too often to print any debug information |
40 |
|
|
✗ |
uint8_t * scratchBuffer = (uint8_t *)tsChannel->scratchBuffer; |
41 |
|
|
|
/** |
42 |
|
|
|
* collect data from all models |
43 |
|
|
|
*/ |
44 |
|
|
✗ |
copyRange(scratchBuffer + 3, getLiveDataFragments(), offset, count); |
45 |
|
|
|
|
46 |
|
|
✗ |
tsChannel->crcAndWriteBuffer(TS_RESPONSE_OK, count); |
47 |
|
|
|
} |
48 |
|
|
|
|
49 |
|
|
|
#endif // EFI_TUNER_STUDIO |
50 |
|
|
|
|