Skip to content
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

FWT-124 FWT-149 We have made changes to ouR TOS #109

Open
wants to merge 125 commits into
base: main
Choose a base branch
from

Conversation

aclowmclaughlin
Copy link
Contributor

@aclowmclaughlin aclowmclaughlin commented Oct 19, 2024

Authors: Rue & Diego
Implemented ThreadX conversion layer. Now, inside the core::rtos namespace, we have c++ objects that wrap the functionality of threadx's c structs. This means that hopefully, those working with RTOS in the future will never have to touch threadx directly. They will never have to sully their bright, beautiful minds with *shudder* complicated c pointer stuff.
Implemented:
BytePools
Threads
EventFlags
Mutexes
Queues
Semaphores

General Structure:
All of the threadx objects inherit from an initializable abstract class that basically just means they need to have an initialize function that registers them with the threadx kernel. This is important because we want to create the c++ objects before we start the kernel, but we have to register them with the kernel after the kernel has started, while the kernel is running.

Unimplemented:
Notification functions; some of the data types have notification functions, but due to c function pointer and c++ object member function weirdness it is difficult to create wrapper functions for these notification functions. The general framework for these notification functions is build into Initializable but is unimplemented for now.

Wrapper Classes:
In addition to our threadx wrappers, we are working towards thread-safe wrapper classes for our own common communication protocols. UARTTX (name courtesy of Diego), our thread-safe UART implementation, works on the surface exactly like normal UART, but actually buffers outputs and works with threadx to ensure thread safety. Plans are in place to create another wrapper like this for CAN and CANopen, possibly. Other communication protocols may be added in the event they become necessary.

…onversionLayer' into feature/aclowmclaughlin/threadxConversionLayer

# Conflicts:
#	src/rtos/BytePool.cpp
…tePool pure abstract class that serves to hide the templated BytePool class when passing it into methods
…pposed to be, and added override keyword to all the inheritors of it.
…e convention. Switched the names of BytePool and BytePoolBase to more accurately reflect the inheritance structure. Created an enum for ThreadX error return values and switched Semaphore, Queue, and Mutex return values to that appropriate enum type.
…onversionLayer' into feature/aclowmclaughlin/threadxConversionLayer

# Conflicts:
#	src/rtos/Threadx.cpp
aclowmclaughlin and others added 21 commits November 10, 2024 13:04
…onversionLayer' into feature/aclowmclaughlin/threadxConversionLayer
…g]" for all the getters to "The returned [thing]"
Also changed all usages of "retrieve" in comments to "get" because Magee hates everything I do.
…num names properly included in documentation.
…es the names and the getters for them. Names are stored in a fixed-size buffer for each class, and are copied out in the getter. This required changing all the classes which is why there appear to be so many changes. Also, initializable is still a virtual class but it's no longer an interface i.e. it does have a cpp.
…snprint instead of vsprint, because it's slightly safer.
…snprint instead of vsprint, because it's slightly safer.
…onversionLayer' into feature/aclowmclaughlin/threadxConversionLayer

# Conflicts:
#	samples/rtos/threadx-demo/main.cpp
#	src/core/io/platform/f3xx/UARTf3xx.cpp
#	src/core/io/platform/f4xx/UARTf4xx.cpp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants