-
Notifications
You must be signed in to change notification settings - Fork 193
Expand file tree
/
Copy pathsys_start.cpp
More file actions
35 lines (29 loc) · 1.02 KB
/
sys_start.cpp
File metadata and controls
35 lines (29 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
///////////////////////////////////////////////////////////////////////////////
// Copyright Christopher Kormanyos 2007 - 2026.
// Distributed under the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt
// or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include <mcal/mcal.h>
#include <os/os.h>
#include <util/utility/util_attribute.h>
#if (defined(__XTENSA__) && !defined(CONFIG_IDF_TARGET_ESP32S3))
extern "C" auto app_main_loop() -> int ATTRIBUTE(used, noinline);
#else
ATTRIBUTE(used, noinline) auto main() -> int;
#endif
#if (defined(__XTENSA__) && !defined(CONFIG_IDF_TARGET_ESP32S3))
auto app_main_loop() -> int
#else
auto main() -> int
#endif
{
// Initialize the microcontroller abstraction layer.
mcal::init();
// Start the multitasking scheduler. This does not return.
// Handle an unexpected return from main() in the startup code.
os::start_os();
#if (defined(__XTENSA__) && !defined(CONFIG_IDF_TARGET_ESP32S3))
return 0;
#endif
}