Index: firmware/source/sys_main.c =================================================================== diff -u -r850f8042a02fd17ee53b8db24bc2e3d17bbb9c7f -rc74c1d99a011dd0fb7f98f183faecda675221fce --- firmware/source/sys_main.c (.../sys_main.c) (revision 850f8042a02fd17ee53b8db24bc2e3d17bbb9c7f) +++ firmware/source/sys_main.c (.../sys_main.c) (revision c74c1d99a011dd0fb7f98f183faecda675221fce) @@ -43,10 +43,6 @@ /* USER CODE BEGIN (0) */ - -static void initProcessor( void ); -static void initSoftware( void ); -static void initTasks( void ); /* USER CODE END */ /* Include Files */ @@ -62,7 +58,12 @@ #include "BLCommon.h" #include "CommBuffers.h" +#include "Download.h" +#include "FPGA.h" #include "Interrupts.h" +#include "NVDataMgmt.h" +#include "OperationModes.h" +#include "SystemComm.h" #include "TaskBG.h" #include "Timers.h" /* USER CODE END */ @@ -76,6 +77,9 @@ */ /* USER CODE BEGIN (2) */ +static void initProcessor( void ); +static void initSoftware( void ); +static void initTasks( void ); /* USER CODE END */ int main(void) @@ -93,28 +97,55 @@ /* USER CODE BEGIN (4) */ + +/************************************************************************* + * @brief initProcessor + * The initProcessor function initializes and configures the processor \n + * peripherals. + * @details Inputs: none + * @details Outputs: Processor peripherals initialized and configured. + * @return none + *************************************************************************/ static void initProcessor( void ) { canInit(); sciInit(); dmaEnable(); } +/************************************************************************* + * @brief initSoftware + * The initSoftware function calls all software unit initialization functions + * to initialize and configure the TD application. + * @details Inputs: none + * @details Outputs: All software units initialized. + * @return none + *************************************************************************/ static void initSoftware( void ) { initCommBuffers(); + initDownload(); + initFPGA(); initInterrupts(); + initNVDataMgmt(); + initOperationModes(); + initSystemComm(); initTimers(); } +/************************************************************************* + * @brief initTasks + * The initTasks function sets up and starts the scheduled tasks. + * @details Inputs: none + * @details Outputs: Scheduled tasks set up and started. + * @return none + *************************************************************************/ static void initTasks( void ) { // Initialize RTI to setup the 3 tasks rtiInit(); rtiEnableNotification( rtiNOTIFICATION_COMPARE0 | rtiNOTIFICATION_COMPARE1 | rtiNOTIFICATION_COMPARE3 ); rtiStartCounter( rtiCOUNTER_BLOCK0 ); - // The timer task requires FIQ enabled - _enable_FIQ(); // The general and priority tasks require IRQ enabled _enable_IRQ(); }