-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
) * Revert "fix(fadec): flex temp unit conversion (#8617)" This reverts commit 8f3494b. * Revert "refactor: Fadec rewrite using Cpp framework (#8547)" This reverts commit 85d0414.
- Loading branch information
Showing
72 changed files
with
6,432 additions
and
6,587 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# This CMakeLists.txt file is used only for syntax highlighting and navigating | ||
# through the code in an IDE. It is not used for building the project. | ||
|
||
cmake_minimum_required(VERSION 3.19) | ||
|
||
project(flybywire-a32nx-fadec) | ||
|
||
set(CMAKE_CXX_STANDARD 20) | ||
set(MSFS_SDK "C:\\MSFS SDK") | ||
|
||
set(CMAKE_CXX_FLAGS "-c -g -DDEBUG -Wno-unused-command-line-argument -Wno-ignored-attributes -Wno-macro-redefined --sysroot \"${MSFS_SDK}/WASM/wasi-sysroot\" -target wasm32-unknown-wasi -flto -D_MSFS_WASM=1 -D__wasi__ -D_LIBCPP_HAS_NO_THREADS -D_WINDLL -D_MBCS -mthread-model single -fno-exceptions -fms-extensions") | ||
|
||
include_directories("${MSFS_SDK}/WASM/include") | ||
include_directories("${MSFS_SDK}/WASM/wasi-sysroot/include") | ||
include_directories("${MSFS_SDK}/SimConnect SDK/include") | ||
|
||
include_directories( | ||
./src | ||
${FBW_ROOT}/fbw-common/src/wasm/fadec_common/src | ||
${FBW_ROOT}/fbw-common/src/wasm/fbw_common/src | ||
${FBW_ROOT}/fbw-common/src/wasm/fbw_common/src/inih | ||
) | ||
|
||
add_executable(flybywire-a32nx-fadec | ||
./src/FadecGauge.cpp | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Engine & FADEC - A32NX/ A380X Build Options | ||
|
||
By default, the FADEC code will be built for the A32NX aircraft. To build for the A380X, you will have to edit the build.sh file accordingly: | ||
|
||
A380X Option: | ||
Line 44: "${DIR}/a380_fadec/src/FadecGauge.cpp" | ||
|
||
To go back to the A32NX Option: | ||
Line 44: "${DIR}/a320_fadec/src/FadecGauge.cpp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
#!/bin/bash | ||
|
||
# Copyright (c) 2021-2023 FlyByWire Simulations | ||
# | ||
# SPDX-License-Identifier: GPL-3.0 | ||
|
||
# get directory of this script relative to root | ||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | ||
COMMON_DIR="${DIR}/../../../../fbw-common/src/wasm" | ||
OUTPUT="${DIR}/../../../out/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/panel/fadec.wasm" | ||
|
||
if [ "$1" == "--debug" ]; then | ||
WASMLD_ARGS="" | ||
CLANG_ARGS="-g" | ||
else | ||
WASMLD_ARGS="-O2 --lto-O2 --strip-debug" | ||
CLANG_ARGS="-flto -O2 -DNDEBUG" | ||
fi | ||
|
||
set -e | ||
|
||
# create temporary folder for o files | ||
mkdir -p "${DIR}/obj" | ||
pushd "${DIR}/obj" | ||
|
||
# compile c++ code for the A32NX | ||
clang++ \ | ||
-c \ | ||
${CLANG_ARGS} \ | ||
-std=c++20 \ | ||
-Wno-unused-command-line-argument \ | ||
-Wno-ignored-attributes \ | ||
-Wno-macro-redefined \ | ||
--sysroot "${MSFS_SDK}/WASM/wasi-sysroot" \ | ||
-target wasm32-unknown-wasi \ | ||
-D_MSFS_WASM=1 \ | ||
-D__wasi__ \ | ||
-D_LIBCPP_HAS_NO_THREADS \ | ||
-D_WINDLL \ | ||
-D_MBCS \ | ||
-mthread-model single \ | ||
-fno-exceptions \ | ||
-fms-extensions \ | ||
-fvisibility=hidden \ | ||
-I "${MSFS_SDK}/WASM/include" \ | ||
-I "${MSFS_SDK}/SimConnect SDK/include" \ | ||
-I "${COMMON_DIR}/fadec_common/src" \ | ||
-I "${COMMON_DIR}/fbw_common/src/inih" \ | ||
-I "${DIR}/common" \ | ||
"${DIR}/src/FadecGauge.cpp" | ||
|
||
# restore directory | ||
popd | ||
|
||
wasm-ld \ | ||
--no-entry \ | ||
--allow-undefined \ | ||
-L "${MSFS_SDK}/WASM/wasi-sysroot/lib/wasm32-wasi" \ | ||
-lc "${MSFS_SDK}/WASM/wasi-sysroot/lib/wasm32-wasi/libclang_rt.builtins-wasm32.a" \ | ||
--export __wasm_call_ctors \ | ||
${WASMLD_ARGS} \ | ||
--export-dynamic \ | ||
--export malloc \ | ||
--export free \ | ||
--export __wasm_call_ctors \ | ||
--export mallinfo \ | ||
--export mchunkit_begin \ | ||
--export mchunkit_next \ | ||
--export get_pages_state \ | ||
--export mark_decommit_pages \ | ||
--export-table \ | ||
--gc-sections \ | ||
-lc++ -lc++abi \ | ||
${DIR}/obj/*.o \ | ||
-o $OUTPUT |
Oops, something went wrong.