rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
main.cpp
Go to the documentation of this file.
1/**
2 * @file main.cpp
3 * @brief C++ main entry point
4 *
5 * See rusefi.cpp for implementation details notes.
6 *
7 * @date Nov 29, 2012
8 * @author Andrey Belomutskiy, (c) 2012-2023
9 * http://rusefi.com/
10 */
11
12#include "pch.h"
13
14#include "rusefi.h"
15#include "mpu_util.h"
16
17#include "fw_configuration.h"
18#include "board_overrides.h"
19
20// this function is used to link all the possibles overrides of the bord, is one of the first func call, before any hw init!
21// use ONLY for the setup of the overrides!!
23
24std::optional<setup_custom_board_overrides_type> custom_board_preHalInit;
25
26int main(void) {
29 // Maybe your board needs to do something special before HAL init
30 preHalInit();
32
33 /*
34 * ChibiOS/RT initialization
35 */
36 halInit();
37 chSysInit();
38
39 /**
40 * most basic MCU initialization - no configuration access, no external hardware access
41 */
43
44 runRusEfi();
45 return 0;
46}
47
48// Weak linked default implementation (not necessarily required for all boards)
49__attribute__((weak)) void preHalInit() { }
void baseMCUInit()
static bool call_board_override(std::optional< FuncType > board_override, Args &&... args)
typedef __attribute__
Ignition Mode.
void setup_custom_fw_overrides()
std::optional< setup_custom_board_overrides_type > custom_board_preHalInit
Pre-HAL initialization override point Allows boards to perform custom initialization before HAL is in...
Definition main.cpp:24
int main(void)
Definition main.cpp:26
void setup_custom_board_overrides()
void runRusEfi()
Definition rusefi.cpp:174
void preHalInit()