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!!
21
22std::optional<setup_custom_board_overrides_type> custom_board_preHalInit;
23
24int main(void) {
26 // Maybe your board needs to do something special before HAL init
27 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 */
40
41 runRusEfi();
42 return 0;
43}
44
45// Weak linked default implementation (not necessarily required for all boards)
46__attribute__((weak)) void preHalInit() { }
void baseMCUInit()
static bool call_board_override(std::optional< setup_custom_board_overrides_type > board_override)
typedef __attribute__
Ignition Mode.
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
int main(void)
Definition main.cpp:24
void setup_custom_board_overrides()
void runRusEfi()
Definition rusefi.cpp:174
void preHalInit()