Speeduino
Loading...
Searching...
No Matches
Functions
logger.cpp File Reference
#include "globals.h"
#include "logger.h"
#include "decoders.h"
#include "init.h"
#include "maths.h"
#include "utilities.h"
#include "units.h"
#include "board_definition.h"

Functions

static byte setStatusBit (byte status, uint8_t index, bool bit)
 
static byte setStatusBits (byte status, bool(&bits)[1])
 
template<uint8_t N>
static byte setStatusBits (byte status, bool(&bits)[N])
 
static byte buildStatus1 (const statuses &current)
 
static byte buildStatus2 (const statuses &current)
 
static byte buildStatus3 (const statuses &current)
 
static byte buildStatus4 (const statuses &current)
 
static byte buildStatus5 (const statuses &current)
 
byte buildEngineStatus (const statuses &current)
 Build the TunerStudio engine status byte from the current status.
 
static byte buildTestOutput (const statuses &current)
 
byte buildSdCardStatus (const statuses &current)
 Build the TunerStudio SD card status byte from the current status.
 
static byte buildAirConStatus (const statuses &current)
 
static byte buildEngineProtectStatus (const statuses &current)
 
byte getTSLogEntry (uint16_t byteNum)
 
int16_t getReadableLogEntry (uint16_t logIndex)
 
uint8_t getLegacySecondarySerialLogEntry (uint16_t byteNum)
 
bool is2ByteEntry (uint8_t key)
 
void startToothLogger (void)
 
void stopToothLogger (void)
 
void startCompositeLogger (void)
 
void stopCompositeLogger (void)
 
void startCompositeLoggerTertiary (void)
 
void stopCompositeLoggerTertiary (void)
 
void startCompositeLoggerCams (void)
 
void stopCompositeLoggerCams (void)
 

Function Documentation

◆ buildAirConStatus()

static byte buildAirConStatus ( const statuses current)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ buildEngineProtectStatus()

static byte buildEngineProtectStatus ( const statuses current)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ buildEngineStatus()

byte buildEngineStatus ( const statuses current)

Build the TunerStudio engine status byte from the current status.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ buildSdCardStatus()

byte buildSdCardStatus ( const statuses current)

Build the TunerStudio SD card status byte from the current status.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ buildStatus1()

static byte buildStatus1 ( const statuses current)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ buildStatus2()

static byte buildStatus2 ( const statuses current)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ buildStatus3()

static byte buildStatus3 ( const statuses current)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ buildStatus4()

static byte buildStatus4 ( const statuses current)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ buildStatus5()

static byte buildStatus5 ( const statuses current)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ buildTestOutput()

static byte buildTestOutput ( const statuses current)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getLegacySecondarySerialLogEntry()

uint8_t getLegacySecondarySerialLogEntry ( uint16_t  byteNum)

An expansion to the getReadableLogEntry function for systems that have an FPU. It will provide a floating point value for any parameter that this is appropriate for, otherwise will return the result of getReadableLogEntry. See logger.h for the field names and order

Parameters
logIndex- The log index required. Note that this is NOT the byte number, but the index in the log
Returns
float value of the requested log entry.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getReadableLogEntry()

int16_t getReadableLogEntry ( uint16_t  logIndex)

Similar to the getTSLogEntry function, however this returns a full, unadjusted (ie human readable) log entry value. See logger.h for the field names and order

Parameters
logIndex- The log index required. Note that this is NOT the byte number, but the index in the log
Returns
Raw, unadjusted value of the log entry. No offset or multiply is applied like it is with the TS log
Here is the call graph for this function:

◆ getTSLogEntry()

byte getTSLogEntry ( uint16_t  byteNum)

Returns a numbered byte-field (partial field in case of multi-byte fields) from "current status" structure in the format expected by TunerStudio Notes on fields:

  • Numbered field will be fields from currentStatus, but not at all in the internal order of strct (e.g. field RPM value, number 14 will be 2nd field in struct)
  • The fields stored in multi-byte types will be accessed lowbyte and highbyte separately (e.g. PW1 will be broken into numbered byte-fields 75,76)
  • Values have the value offsets and shifts expected by TunerStudio. They will not all be a 'human readable value'
    Parameters
    byteNum- byte-Field number. This is not the entry number (As some entries have multiple byets), but the byte number that is needed
    Returns
    Field value in 1 byte size struct fields or 1 byte partial value (chunk) on multibyte fields.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ is2ByteEntry()

bool is2ByteEntry ( uint8_t  key)

Searches the log 2 byte array to determine whether a given index is a regular single byte or a 2 byte field Uses a boundless binary search for improved performance, but requires the fsIntIndex to remain in order

Parameters
key- Index in the log array to check
Returns
True if the index is a 2 byte log field. False if it is a single byte
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setStatusBit()

static byte setStatusBit ( byte  status,
uint8_t  index,
bool  bit 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setStatusBits() [1/2]

static byte setStatusBits ( byte  status,
bool(&)  bits[1] 
)
inlinestatic
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setStatusBits() [2/2]

template<uint8_t N>
static byte setStatusBits ( byte  status,
bool(&)  bits[N] 
)
inlinestatic
Here is the call graph for this function:

◆ startCompositeLogger()

void startCompositeLogger ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ startCompositeLoggerCams()

void startCompositeLoggerCams ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ startCompositeLoggerTertiary()

void startCompositeLoggerTertiary ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ startToothLogger()

void startToothLogger ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ stopCompositeLogger()

void stopCompositeLogger ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ stopCompositeLoggerCams()

void stopCompositeLoggerCams ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ stopCompositeLoggerTertiary()

void stopCompositeLoggerTertiary ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ stopToothLogger()

void stopToothLogger ( void  )
Here is the call graph for this function:
Here is the caller graph for this function: