The C29 compiler can leverage the parallelism of the C29 architecture, executing multiple instructions in parallel especially in cases where independent operations occur sequentially. For example, the code block below demonstrates two identical PID operations that occur sequentially. If DCL_runPID is declared as a static function in a header file, the compiler can perform inlining and then perform the two PID operations in parallel.Note: However, in order to achieve performance improvement with the parallelized operations, it may also be necessary to place memory objects in different RAM blocks so as to avoid memory stalls when simultaneously accessing objects associated with independent execution (e.g. PID) instances.
float run_dualPID(DCL_PID *restrict p1, DCL_PID *restrict p2,float32_t rk1, float32_t yk1, float32_t lk1,float32_t rk2, float32_t yk2, float32_t lk2)
{
float x = DCL_runPID_C3(p1, rk1, yk1, lk1);
float y = DCL_runPID_C3(p2, rk2, yk2, lk2);
return x+y;
}