Speeduino
Loading...
Searching...
No Matches
Functions
init.cpp File Reference
#include "globals.h"
#include "init.h"
#include "storage.h"
#include "updates.h"
#include "timers.h"
#include "comms.h"
#include "comms_secondary.h"
#include "comms_CAN.h"
#include "programmableIOControl.h"
#include "scheduler.h"
#include "schedule_calcs.h"
#include "auxiliaries.h"
#include "sensors.h"
#include "decoders.h"
#include "corrections.h"
#include "idle.h"
#include "table2d.h"
#include "acc_mc33810.h"
#include "board_definition.h"
#include "pages.h"
#include "fuel_calcs.h"
#include "decoder_init.h"
#include "scheduledIO_ign.h"
#include "scheduledIO_inj.h"
#include "scheduledIO_direct_ign.h"
#include "scheduledIO_direct_inj.h"
#include "src/pins/pinMapping.h"
#include "resetControl.h"
#include "scheduler_ignition_controller.h"
#include "maths.h"

Functions

static void processResetStorageRequest (void)
 Allow the user to reset the firmware storage (aka EPROM).
 
void initialiseAll (void)
 
void setPinMapping (byte boardID)
 

Detailed Description

Speeduino Initialisation (called at Arduino setup()).

Function Documentation

◆ initialiseAll()

void initialiseAll ( void  )

Initialise Speeduino for the main loop. Top level init entry point for all initialisations:

  • Initialise and set sizes of 3D tables
  • Load config from EEPROM, update config structures to current version of SW if needed.
  • Initialise board (The initBoard() is for board X implemented in board_X.ino file)
  • Initialise timers (See timers.ino)
  • Perform optional SD card and RTC battery inits
  • Load calibration tables from EEPROM
  • Perform pin mapping (calling setPinMapping() based on config2::pinMapping)
  • Stop any coil charging and close injectors
  • Initialise schedulers, Idle, Fan, auxPWM, Corrections, AD-conversions, Programmable I/O
  • Initialise baro (ambient pressure) by reading MAP (before engine runs)
  • Initialise triggers (by initialiseTriggers() )
  • Perform cyl. count based initialisations (config2::nCylinders)
  • Perform injection and spark mode based setup
    • Assign injector open/close and coil charge begin/end functions to their dedicated global vars
  • Perform fuel pressure priming by turning fuel pump on
  • Read CLT and TPS sensors to have cranking pulsewidths computed correctly
  • Mark Initialisation completed (this flag-marking is used in code to prevent after-init changes)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ processResetStorageRequest()

static void processResetStorageRequest ( void  )
static

Allow the user to reset the firmware storage (aka EPROM).

This gives the user the opportunity to clear the permanent storage at start up.

See https://github.com/noisymime/speeduino/pull/657

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

◆ setPinMapping()

void setPinMapping ( byte  boardID)

Set board / microcontroller specific pin mappings / assignments. The boardID is switch-case compared against raw boardID integers (not enum or defined label, and probably no need for that either) which are originated from tuning SW (e.g. TS) set values and are available in reference/speeduino.ini (See pinLayout, note also that numbering is not contiguous here).

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