-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clean main and init files from different architectures #151
Merged
Merged
Changes from 47 commits
Commits
Show all changes
48 commits
Select commit
Hold shift + click to select a range
0e55f4b
fix new device interface in ctfTracer test
cochicde 8dbe5b6
first part
cochicde 7095b0f
cleanup all archs
cochicde 4ca64a3
Merge remote-tracking branch 'origin/develop' into clean-main
cochicde 924e58d
fix merge conflict
cochicde 9f8a794
add missing flag for shared library
cochicde 242f3dc
fix windows architecture declaration and cleanup startuphook file
cochicde ea89b0d
Update src/arch/forte.cpp
cochicde 581f023
Update src/arch/forte.cpp
cochicde ccf943e
Apply suggestions from code review
cochicde fe0ab41
some more cleanup
cochicde c885559
Merge branch 'clean-main' of github.com:cochicde/4diac-forte into cle…
cochicde cef37e2
fix all comments
cochicde 7f82c8a
fix all
cochicde a6c0299
limit shared library test only when forte is build as shared library
cochicde ed7c92c
move signals hook to each arch
cochicde 853c756
use devlog in freeRTOS
cochicde df4aef8
add typedef when compiling as C
cochicde 0bc7d6f
Merge remote-tracking branch 'origin/develop' into clean-main
cochicde d547ea7
separate c interface library and add test for it
cochicde ae4b5a6
Merge remote-tracking branch 'origin/develop' into clean-main
cochicde 8b4511d
clean freertos main
cochicde 21acd20
try fix on windows
cochicde 9056c2b
try windows fix 2
cochicde 5dc7fac
do some more cleanup
cochicde 5baf266
last cleanup, promise
cochicde c026dab
build libraries in github workflows
cochicde 52faabd
link boost library only in posix
cochicde f33a6b0
add linker option also to new tests
cochicde a0b71ba
fix boost include
cochicde 35e0c58
export windows symbols for shared library
cochicde 21700b2
try fixing windows issue
cochicde e7a14ef
export windows symbols at a global level
cochicde 986aef3
disable shared library test in windows
cochicde cd563e8
update headers
cochicde b27df14
Merge remote-tracking branch 'origin/develop' into clean-main
cochicde 1f9ebd8
Merge remote-tracking branch 'origin/develop' into clean-main
cochicde 6e55f1f
add delay in tests
cochicde 44ea506
fixes after feedback
cochicde a41dc27
remove template parameter from general architecture
cochicde fd47279
use BOOST_TEST where possible
cochicde 9ea8b84
use helper function to print response type
cochicde a4a624b
fix linker flags
cochicde 663b0d7
fix linker flags properly
cochicde 0c669d0
Merge remote-tracking branch 'origin/develop' into clean-main
cochicde 29dca66
make linker libraries for C library PUBLIC
cochicde 45cd92d
remove link to shared boost
cochicde 0e9f85f
use unnamed namespace in freeRTOS main
cochicde File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Large diffs are not rendered by default.
Oops, something went wrong.
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,82 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2018 - 2024 fortiss GmbH, Jose Cabral | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Jose Cabral - initial API and implementation and/or initial documentation | ||
*******************************************************************************/ | ||
|
||
#ifndef SRC_ARCH_FORTE_C_H_ | ||
#define SRC_ARCH_FORTE_C_H_ | ||
|
||
#ifndef FORTE_SHARED_PREFIX | ||
#define FORTE_SHARED_PREFIX | ||
#endif | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
typedef enum FORTE_STATUS{ | ||
FORTE_OK = 0, | ||
FORTE_DEVICE_ALREADY_STARTED, | ||
FORTE_WRONG_ENDIANESS, | ||
FORTE_WRONG_PARAMETERS, | ||
FORTE_ARCHITECTURE_NOT_READY, | ||
FORTE_COULD_NOT_CREATE_DEVICE, | ||
} FORTE_STATUS; | ||
|
||
typedef void* TForteInstance; | ||
|
||
/** | ||
* \brief Start forte instance | ||
* @param paPort The port on which forte will listen. Use 0 for default 61499 | ||
* @param paResultInstance Address to store the created forte instance | ||
* @return FORTE_OK if no error occurred, other values otherwise | ||
*/ | ||
FORTE_SHARED_PREFIX FORTE_STATUS forteStartInstance(unsigned int paPort, TForteInstance* paResultInstance); | ||
|
||
/** | ||
* \brief Start forte instance with posibilities of more arguments | ||
* @param argc Number of arguments in arg | ||
* @param argv Arguments | ||
* @param paResultInstance Address to store the created forte instance | ||
* @return FORTE_OK if no error occurred, other values otherwise | ||
*/ | ||
FORTE_SHARED_PREFIX FORTE_STATUS forteStartInstanceGeneric(int argc, char *argv[], TForteInstance* paResultInstance); | ||
|
||
/** | ||
* \brief Request termination of a Forte instance | ||
* @param paInstance Instance to request for termination | ||
*/ | ||
FORTE_SHARED_PREFIX void forteRequestStopInstance(TForteInstance paInstance); | ||
|
||
/** | ||
* \brief Waits indefinitely for the intance to stop and deletes it | ||
* @param paInstance Instance to terminate | ||
*/ | ||
FORTE_SHARED_PREFIX void forteWaitForInstanceToStop(TForteInstance paInstance); | ||
|
||
/** | ||
* \brief Initializes the architecture. Prepare all resources needed by the Forte's instances. Must be called once before the first Forte instance is started | ||
* @param argc Number of arguments in arg | ||
* @param argv Arguments | ||
* @return 0 if no error occurred, other values otherwise. Any error value is provided by the architecture and not by forte | ||
*/ | ||
FORTE_SHARED_PREFIX int forteGlobalInitialize(int argc, char *argv[]); | ||
|
||
/** | ||
* \brief Deinitializes the architecture. Frees all resources used by Forte's instances. Must be called after the last instance is ended | ||
* @return 0 if no error occurred, other values otherwise. Any error value is provided by the architecture and not by forte | ||
*/ | ||
FORTE_SHARED_PREFIX int forteGlobalDeinitialize(); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* SRC_ARCH_FORTE_C_H_ */ |
22 changes: 8 additions & 14 deletions
22
src/arch/win32/forte_instance.h → ...ch/common/forte_specific_architecture.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 |
---|---|---|
@@ -1,27 +1,21 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2017 fortiss GmbH | ||
* Copyright (c) 2024 Jose Cabral | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Jose Cabral, Alois Zoitl - initial API and implementation and/or initial documentation | ||
* Jose Cabral - initial API and implementation and/or initial documentation | ||
*******************************************************************************/ | ||
|
||
#ifndef FORTE_INSTANCE_H_ | ||
#define FORTE_INSTANCE_H_ | ||
#include "arch/forte_specific_architecture.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
void startupFORTE(); | ||
void shutdownFORTE(); | ||
|
||
#ifdef __cplusplus | ||
int CForteSpecificArchitecture::initialize(int , char** ){ | ||
return 0; | ||
} | ||
#endif | ||
|
||
#endif | ||
int CForteSpecificArchitecture::deinitialize() { | ||
return 0; | ||
} |
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file does not seem to be architecture-dependent. Should this not rather live directly in
src
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agrre, but before moving it I would leave that for discussion mainly because there was a similar case somewhere up there in the comments regarding the
startuphook
file@azoitl
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
currently we have everything that is used to start 4diac FORTE on a specific device in the arch folder. Therefore I would like to keep it here. Because when I'm porting 4diac FORTE to a new device I would look here first.