OpenCores
URL https://opencores.org/ocsvn/light52/light52/trunk

Subversion Repositories light52

[/] [light52/] [trunk/] [test/] [hello_c/] [src/] [hello.c] - Blame information for rev 13

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 3 ja_rd
/**
2
    @file hello.c
3
    @brief Hello World demo for light52 core.
4
 
5
    Does nothing but send a greeting string to the console.
6
    Should fit in 2K of ROM and use no XRAM.
7
*/
8
#include <stdio.h>
9
#include "../../include/light52.h"
10
 
11
/*-- Public functions --------------------------------------------------------*/
12
 
13
void main(void){
14
    /* The UART is left in its default reset state: 19200-8-N-1 */
15
 
16
    printf("\n\r");
17
    printf("Light52 project -- " __DATE__ "\n\n\r");
18
    printf("Hello World!\n\r");
19
 
20
    while(1);
21
}
22
 
23
/*-- Local functions ---------------------------------------------------------*/
24
 
25
/**
26
    Stdclib putchar replacement function.
27
    Relies on polling for simplicity and does CR to CRLF expansion.
28
 
29
    @arg c Character to be displayed. Character '\n' will be expanded to '\n\r'.
30
*/
31
void putchar (char c) {
32
    while (!TXRDY);
33
    SBUF = c;
34
    if(c=='\n'){
35
        while (!TXRDY);
36
        SBUF = '\r';
37
    }
38
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.