/*******************************************************************************
  Main Source File

  Company:
    Microchip Technology Inc.

  File Name:
    main.c

  Summary:
    This file contains the "main" function for a project.

  Description:
    This file contains the "main" function for a project.  The
    "main" function calls the "SYS_Initialize" function to initialize the state
    machines of all modules in the system
 *******************************************************************************/

// *****************************************************************************
// *****************************************************************************
// Section: Included Files
// *****************************************************************************
// *****************************************************************************

#include <stddef.h>                     // Defines NULL
#include <stdbool.h>                    // Defines true
#include <stdlib.h>                     // Defines EXIT_FAILURE
#include "definitions.h"                // SYS function prototypes


// *****************************************************************************
// *****************************************************************************
// Section: Main Entry Point
// *****************************************************************************
// *****************************************************************************


#include <stdio.h>

int main ( void )
{
    uint8_t writeBuffer[5];
    //uint8_t readBuffer[40];
    //int writtenBytes = 0;
    //int readIndex    = 0;

    writeBuffer[0] = 0xAA;
    writeBuffer[1] = 0x55;
    writeBuffer[2] = 0x00;
    writeBuffer[3] = 0x1E;
    writeBuffer[4] = 0x1F;
    
    /* Initialize all modules */
    SYS_Initialize ( NULL );
    //__delay_ms( 5 );
    //printf("Hello world\n");
     UART1_Write( writeBuffer, sizeof( writeBuffer ) )  ;
    
    while ( true )
    {
        /* Maintain state machines of all polled MPLAB Harmony modules. */
        SYS_Tasks ( );
    }

    /* Execution should not come here during normal operation */

    return ( EXIT_FAILURE );
}


/*******************************************************************************
 End of File
*/

