When i'm doing code using MCC for example i will put my code the following way:
#include "stdio.h"
#include <xc.h>
#include "mcc_generated_files/mcc.h"
void main(void)
{
SYSTEM_Initialize();
printf("Booting loop debugger\r\n");
LED_GREEN_Toggle();
loop_debug_initialize();// start debug variables
loop_initialize();
while (1)
{
loop_debug_manage();
}
}
My question now is using the Harmony framework i have something like this:
int main ( void )
{
__XC_UART = 1; // Code is configured to use UART1
/* Initialize all MPLAB Harmony modules, including application(s). */
SYS_Initialize ( NULL );
while ( true )
{
/* Maintain state machines of all polled MPLAB Harmony modules. */
SYS_Tasks ( );
}
/* Execution should not come here during normal operation */
return ( EXIT_FAILURE );
}
Where shall i put the same code? can i put everything on main? like this:
int main ( void )
{
__XC_UART = 1; // Code is configured to use UART1
/* Initialize all MPLAB Harmony modules, including application(s). */
SYS_Initialize ( NULL );
loop_debug_initialize();// start debug variables
loop_initialize();
while ( true )
{
/* Maintain state machines of all polled MPLAB Harmony modules. */
SYS_Tasks ( );
loop_debug_manage();
}
/* Execution should not come here during normal operation */
return ( EXIT_FAILURE );
}
Or this is not ok?
Does it need to go inside void SYS_Tasks ( void )
?
It's my first time working with Harmony, so any help is appreciated.