Speeduino
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
IgnitionSchedule Struct Reference

An ignition schedule. More...

#include <scheduler.h>

Inheritance diagram for IgnitionSchedule:
Inheritance graph
[legend]
Collaboration diagram for IgnitionSchedule:
Collaboration graph
[legend]

Public Member Functions

void reset (void) override
 
constexpr Schedule (counter_t &counter, compare_t &compare)
 Construct a new Schedule object.
 
- Public Member Functions inherited from Schedule
constexpr Schedule (counter_t &counter, compare_t &compare)
 Construct a new Schedule object.
 

Public Attributes

volatile uint32_t _startTime
 The system time (in uS) that the schedule started, used by the overdwell protection in timers.ino.
 
int16_t chargeAngle
 Angle the coil should begin charging.
 
int16_t dischargeAngle
 Angle the coil should discharge at. I.e. spark.
 
int16_t channelDegrees
 The number of crank degrees until cylinder is at TDC

 
- Public Attributes inherited from Schedule
volatile COMPARE_TYPE duration = 0U
 Scheduled duration (timer ticks)
 
volatile ScheduleStatus Status = OFF
 Schedule status: OFF, PENDING, STAGED, RUNNING.
 
callback pStartCallback = &nullCallback
 Start Callback function for schedule.
 
callback pEndCallback = &nullCallback
 End Callback function for schedule.
 
COMPARE_TYPE nextStartCompare = 0U
 Planned start of next schedule (when current schedule is RUNNING)
 
counter_t_counter
 Reference to the counter register. E.g. TCNT3
 
compare_t_compare
 **Reference**to the compare register. E.g. OCR3A
 

Additional Inherited Members

- Public Types inherited from Schedule
using counter_t = decltype(FUEL1_COUNTER)
 The type of a timer counter register (this varies between platforms)
 
using compare_t = decltype(FUEL1_COMPARE)
 The type of a timer compare register (this varies between platforms)
 
using callback = void(*)(void)
 

Detailed Description

An ignition schedule.

Goal is to fire the spark as close to the requested angle as possible.

<--------------- Delay ---------------><---- Charge Coil ---->
^
static TIntegral readSerialIntegralTimeout(void)
Reads an integral type, timing out if necessary.
Definition comms.cpp:175

Terminology: dwell is the period when the ignition system applies an electric current to the ignition coil's primary winding in order to charge up the coil so it can generate a spark.

Note that dwell times use uint16_t & therefore maximum dwell is 65.535ms. This limit is imposed elsewhere in Speeduino also.

Member Function Documentation

◆ reset()

void IgnitionSchedule::reset ( void  )
overridevirtual

Reimplemented from Schedule.

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

◆ Schedule()

constexpr Schedule::Schedule ( counter_t counter,
compare_t compare 
)
inlineconstexpr

Construct a new Schedule object.

Parameters
counterA reference to the timer counter
compareA reference to the timer comparator

Member Data Documentation

◆ _startTime

volatile uint32_t IgnitionSchedule::_startTime

The system time (in uS) that the schedule started, used by the overdwell protection in timers.ino.

◆ channelDegrees

int16_t IgnitionSchedule::channelDegrees

The number of crank degrees until cylinder is at TDC

◆ chargeAngle

int16_t IgnitionSchedule::chargeAngle

Angle the coil should begin charging.

◆ dischargeAngle

int16_t IgnitionSchedule::dischargeAngle

Angle the coil should discharge at. I.e. spark.


The documentation for this struct was generated from the following files: