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

Merged
merged 128 commits into from
Dec 7, 2024

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 17 commits November 16, 2024 11:53
…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
Copy link
Contributor

@mjh9585 mjh9585 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Get the time base stuff in, then your good.

@aclowmclaughlin aclowmclaughlin merged commit d5b7812 into main Dec 7, 2024
1 check passed
@aclowmclaughlin aclowmclaughlin deleted the feature/aclowmclaughlin/threadxConversionLayer branch December 7, 2024 19:05
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