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
#include "
board_overrides.h
"
17
18
// this function is used to link all the possibles overrides of the bord, is one of the first func call, before any hw init!
19
// use ONLY for the setup of the overrides!!
20
void
setup_custom_board_overrides
();
21
22
std::optional<setup_custom_board_overrides_type>
custom_board_preHalInit
;
23
24
int
main
(
void
) {
25
setup_custom_board_overrides
();
26
// Maybe your board needs to do something special before HAL init
27
preHalInit
();
28
call_board_override
(
custom_board_preHalInit
);
29
30
/*
31
* ChibiOS/RT initialization
32
*/
33
halInit();
34
chSysInit();
35
36
/**
37
* most basic MCU initialization - no configuration access, no external hardware access
38
*/
39
baseMCUInit
();
40
41
runRusEfi
();
42
return
0;
43
}
44
45
// Weak linked default implementation (not necessarily required for all boards)
46
__attribute__
((weak))
void
preHalInit
() { }
baseMCUInit
void baseMCUInit()
Definition
at32_common.cpp:146
board_overrides.h
call_board_override
static bool call_board_override(std::optional< setup_custom_board_overrides_type > board_override)
Definition
board_overrides.h:65
__attribute__
typedef __attribute__
Ignition Mode.
Definition
rusefi_enums.h:53
custom_board_preHalInit
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:22
main
int main(void)
Definition
main.cpp:24
setup_custom_board_overrides
void setup_custom_board_overrides()
Definition
board_configuration.cpp:40
mpu_util.h
pch.h
runRusEfi
void runRusEfi()
Definition
rusefi.cpp:174
rusefi.h
preHalInit
void preHalInit()
Generated on Sat Sep 27 2025 00:10:07 for rusEFI by
1.9.8