summaryrefslogtreecommitdiffstats
path: root/main.cpp
blob: af9e2aa1ff736aa65daa414f1688464f611c8089 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/* 
 * File:   main.c
 * Author: naopross
 *
 * Created on May 1, 2018, 6:18 PM
 */

#include <stdio.h>
#include <stdlib.h>

#include "mcc_generated_files/mcc.hpp"

/*
 * 
 */
int main(int argc, char** argv)
{
    char c;
    
    SYSTEM_Initialize();
    
    LED1_SetHigh();
    LED2_SetHigh();
    LED3_SetHigh();
    
    // UART1_WriteBuffer("Hello\n\r", 7);
    UART1_Write('S');
    UART1_Write('\n');
    UART1_Write('\r');
    
    while (1) {
        while (UART1_ReceiveBufferIsEmpty());
        
        c = UART1_Read();
        LED1_Toggle();
        
        UART1_Write(c);
        UART1_Write('\n');
        UART1_Write('\r');
    }

    return (EXIT_SUCCESS);
}