rusefi-1/firmware/console/binary/tooth_logger.h

48 lines
1.1 KiB
C
Raw Normal View History

2019-07-07 12:22:46 -07:00
/*
* @file tooth_logger.h
*
* @date Jul 7, 2019
* @author Matthew Kennedy
*/
#pragma once
#include <cstdint>
#include <cstddef>
#include "efitime.h"
#include "rusefi_enums.h"
#include "engine.h"
2020-07-19 21:36:10 -07:00
#if EFI_UNIT_TEST
#include "logicdata.h"
int copyCompositeEvents(CompositeEvent *events);
#endif // EFI_UNIT_TEST
2020-05-26 19:30:53 -07:00
int getCompositeRecordCount();
void EnableToothLoggerIfNotEnabled();
// Enable the tooth logger - this clears the buffer starts logging
void EnableToothLogger();
// Stop logging - leave buffer intact
void DisableToothLogger();
// A new tooth has arrived! Log to the buffer if enabled.
void LogTriggerTooth(trigger_event_e tooth, efitick_t timestamp DECLARE_ENGINE_PARAMETER_SUFFIX);
void LogTriggerTopDeadCenter(efitick_t timestamp DECLARE_ENGINE_PARAMETER_SUFFIX);
2020-05-25 21:07:18 -07:00
void LogTriggerCoilState(efitick_t timestamp, bool state DECLARE_ENGINE_PARAMETER_SUFFIX);
void LogTriggerInjectorState(efitick_t timestamp, bool state DECLARE_ENGINE_PARAMETER_SUFFIX);
struct ToothLoggerBuffer
{
const uint8_t* const Buffer;
const size_t Length;
};
// Get a reference to the buffer
ToothLoggerBuffer GetToothLoggerBuffer();