diff --git a/README.md b/README.md index 96ea151..3a1a3e0 100644 --- a/README.md +++ b/README.md @@ -124,11 +124,14 @@ Therefore, total latency is slightly over 23.07ms. The exact latency could not b The total CPU usage is calculated by dividing the total latency by the highest initiation time. In this case the CPU usage is ~25%. -## Shared data structures +## Shared data structures & dependencies * `currentStepSize`, safe access guaranteed using `std::atomic`, stores the step size of the most recently pressed key, to be used within `sampleISR()` * `keyArray`, each element within the array is of type `std::atomic`, stores the current state of the key / encoder matrix * `msgInQ`, handled by FreeRTOS, pointer to the next item in the received CAN message queue +* `latestKey`, guarded by `std::atomic`, ensures that the current note is maintained as an integer value +* `selectedWaveform` is an int (`std::atomic`) corresponding to the currently selected Waveform type, that determined if the output is a Sawtooth, Square, Triangle or Sine wave. +* `octave` is modified when the key is changed and the message displayed on the screen needs to be displayed, stored as an int. It was decided to use C++ `std::atomic`, as it is easier to use and implement, while providing the same functionality as a mutex. According to the documentation: *"Each instantiation and full specialization of the std::atomic template defines an atomic type. If one thread writes to an atomic object while another thread reads from it, the behavior is well-defined (see memory model for details on data races). In addition, accesses to atomic objects may establish inter-thread synchronization and order non-atomic memory accesses as specified by std::memory_order.*" - [CPP Reference "std::atomic"](https://en.cppreference.com/w/cpp/atomic/atomic) @@ -136,6 +139,8 @@ It was decided to use C++ `std::atomic`, as it is easier to use and implement, w `msgInQ` is used as a FIFO buffer for CAN messages, to supplement the small buffer of the CAN system and allow for more messages to be retained, increasing the required minimum initiation time. +![Dependency Graph](docs/DependencyGraph.png) + ## Analysis of inter-task blocking dependencies ## Advanced features diff --git a/docs/DependencyGraph.png b/docs/DependencyGraph.png new file mode 100644 index 0000000..d597b79 Binary files /dev/null and b/docs/DependencyGraph.png differ