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

Subversion Repositories edge

[/] [edge/] [trunk/] [SW/] [Apps/] [stdio.c] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 heshamelma
#include "stdio.h"
2
#include "uart.h"
3
 
4
void putc(char c)
5
{
6
  uart_send_byte(c);
7
}
8
 
9
void printf(char *string)
10
{
11
  int i;
12
  for (i=0; string[i] != '\0'; i++)
13
  {
14
    putc(string[i]);
15
  }
16
}
17
 
18
void printInt(int num)
19
{
20
  int i = 0;
21
  // print first 3 digits.
22
  putc(((num%1000)/100) + 48);
23
  putc(((num % 100)/10) + 48);
24
  putc((num % 10) + 48);
25
 
26
}

powered by: WebSVN 2.1.0

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