diff --git a/src/SuperLoop/SuperLoop.c b/src/SuperLoop/SuperLoop.c index 41dc003..3800138 100644 --- a/src/SuperLoop/SuperLoop.c +++ b/src/SuperLoop/SuperLoop.c @@ -1,15 +1,50 @@ /* - * Author: username - * Date: 2024 + * Author: Jake G + * Date: 2024-09-01 * filename: SuperLoop.c - * description: module_purpose + * description: The RT super loop. */ #include "SuperLoop.h" +#include -// dumb test function -int add_two(int a) { - int b = a; - b += 2; - return b; + +static uint8_t iteration_target = 0; + +/* + * #################################### + * PRIVATE FUNCTIONS + * #################################### + */ + +static bool continue_looping(uint8_t idx) +{ + if(iteration_target == 0 || idx <= iteration_target) { + return true; + } + return false; } + + +/* + * #################################### + * PUBLIC FUNCTIONS + * #################################### + */ + + + +void SuperLoop_SetIterations(uint8_t n) +{ + iteration_target = n; +} + + +void SuperLoop_Run(void) +{ + for(uint8_t i = 0; continue_looping(i); i++) { + continue; + } +} + + diff --git a/src/SuperLoop/SuperLoop.h b/src/SuperLoop/SuperLoop.h index 1b2124d..faf4786 100644 --- a/src/SuperLoop/SuperLoop.h +++ b/src/SuperLoop/SuperLoop.h @@ -1,8 +1,8 @@ /** - * @brief PUT_TEXT_HERE - * @details This file is... - * @author username - * @date todays_date + * @brief The Systems superloop that handles all the tasks. + * @details This file is the main program's logic that loops endlessly + * @author Jake G + * @date 2024-09-01 * @copyright None * @file SUPERLOOP.h */ @@ -10,10 +10,21 @@ #ifndef SUPERLOOP #define SUPERLOOP +#include + /** - * A function that adds two to a number - * @param a The first argument + * A function that allows the user to set the number of loop iterations for + * testing purposes. + * @param n The number of times it will loop before breaking. (Zero is endless) */ -int add_two(int a); +void SuperLoop_SetIterations(uint8_t n); + + +/** + * The super loop; it runs the main code in a loop endlessly unless the number + * of iterations are set. + */ +void SuperLoop_Run(void); + #endif // SUPERLOOP