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 "preprocessor.h"
#include "units.h"
#include "board_definition.h"
#include "decoder_init.h"
#include "scheduledIO_inj.h"
#include "resetControl.h"
#include "scheduler_fuel_controller.h"
#include "src/controllers/progammableIO/programmableIOControl.h"

Functions

static byte setStatusBit (byte status, uint8_t index, bool bit)
 
static byte setStatusBits (byte status, bool(&bits)[1]) noexcept
 
template<uint8_t N>
static byte setStatusBits (byte status, bool(&bits)[N]) noexcept
 
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)
 
static void attachLoggerInterrupt (uint8_t pin, void(*loggerISR)(void))
 
void startToothLogger (void)
 
static void detachLoggerInterrupt (uint8_t pin, interrupt_t &decoderInterrupt)
 
void stopToothLogger (void)
 
void startCompositeLogger (void)
 
void stopCompositeLogger (void)
 
void startCompositeLoggerTertiary (void)
 
void stopCompositeLoggerTertiary (void)
 
void startCompositeLoggerCams (void)
 
void stopCompositeLoggerCams (void)
 

Function Documentation

◆ attachLoggerInterrupt()

static void attachLoggerInterrupt ( uint8_t  pin,
void(*)(void)  loggerISR 
)
inlinestatic

◆ buildAirConStatus()

static byte buildAirConStatus ( const statuses current)
static

◆ buildEngineProtectStatus()

static byte buildEngineProtectStatus ( const statuses current)
static

◆ buildEngineStatus()

byte buildEngineStatus ( const statuses current)

Build the TunerStudio engine status byte from the current status.

◆ buildSdCardStatus()

byte buildSdCardStatus ( const statuses current)

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

◆ buildStatus1()

static byte buildStatus1 ( const statuses current)
static

◆ buildStatus2()

static byte buildStatus2 ( const statuses current)
static

◆ buildStatus3()

static byte buildStatus3 ( const statuses current)
static

◆ buildStatus4()

static byte buildStatus4 ( const statuses current)
static

◆ buildStatus5()

static byte buildStatus5 ( const statuses current)
static

◆ buildTestOutput()

static byte buildTestOutput ( const statuses current)
static

◆ detachLoggerInterrupt()

static void detachLoggerInterrupt ( uint8_t  pin,
interrupt_t decoderInterrupt 
)
inlinestatic

◆ getLegacySecondarySerialLogEntry()

uint8_t getLegacySecondarySerialLogEntry ( uint16_t  byteNum)

◆ 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

◆ 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.

◆ 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

◆ setStatusBit()

static byte setStatusBit ( byte  status,
uint8_t  index,
bool  bit 
)
static

◆ setStatusBits() [1/2]

static byte setStatusBits ( byte  status,
bool(&)  bits[1] 
)
inlinestaticnoexcept

◆ setStatusBits() [2/2]

template<uint8_t N>
static byte setStatusBits ( byte  status,
bool(&)  bits[N] 
)
inlinestaticnoexcept

◆ startCompositeLogger()

void startCompositeLogger ( void  )

◆ startCompositeLoggerCams()

void startCompositeLoggerCams ( void  )

◆ startCompositeLoggerTertiary()

void startCompositeLoggerTertiary ( void  )

◆ startToothLogger()

void startToothLogger ( void  )

◆ stopCompositeLogger()

void stopCompositeLogger ( void  )

◆ stopCompositeLoggerCams()

void stopCompositeLoggerCams ( void  )

◆ stopCompositeLoggerTertiary()

void stopCompositeLoggerTertiary ( void  )

◆ stopToothLogger()

void stopToothLogger ( void  )