Closed kammce closed 3 years ago
After attempting to move everything to Returns
Where as exceptions takes up a fixed amount of 8kB of memory when enabled. This seems like the logical path for most system that have sufficient memory, such as 64kB devices and above.
How do we create an environment that allows for packages to be "installed" and included in a project? How can we make it fit the current folder hierachy of L1, L2, L3, L4? We want to use git for this. Do we have library developers create the same folder hiearchy in there projects and simply -I
include a folder of a clone of that repo?
The answer is yes and the PollingVerification()
makes it easy to do this and do it right.
The last item in the big unsolved issus to not be solved is C++11 threads but this is mentioned in #427
1. Should all methods of all hardware interfaces use Returns, basically assume that any and all hardware interfaces have the capability to return an error?
Answer: Yes. Proof:
Evidence:
1) I2C to GPIO (io expander), I2C to PWM, and I2C to SPI converters are examples of how the I2C com-protocol can be used to generate other peripherals. 2) Some SOCs use I2C internally to communicate to embedded peripherals
2. Can memory map register polling be reliably unit tested?
1) Option 1: Create a PollRegister() class/function that is different between testing and runtime.
and this is too large of a change to be acceptable.
Chosen Option
Option 2 + Option 3 where option 3 is realized using a generic DetectPolling() that can be used during testing to detect if a method/function is stalled Then the rest of the code should set the flags at the start. This way, the test is only polling for those test, proving that they halt when the flag is not set, but when the flag IS set, they proceed as normal.
3. Leveraging C++11 threads
The idea would be to bring in C++11 threads and make them optional for the developers. But, std::thread, and the creation of threads is strictly forbidden within SJSU-Dev2, except in cases where we are creating libraries to assist in the creation of threads.
All libraries that would need some sort of real time control must present an
Update()
(maybe come up with a better name) function that must be called by a thread to get a process to continue, similiar to how graphics libraries do not control their own thread but let the developer call theirrefresh()
functions when they want to.There is potential to support and use through out the code base, things such as std::mutex, and C++20's std::binary_semaphore and other primitives that use FreeRTOS in the back.