File: printf.h

package info (click to toggle)
avr-libc 20020203-2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 1,448 kB
  • ctags: 6,562
  • sloc: ansic: 7,631; asm: 4,424; sh: 2,703; makefile: 338; pascal: 289
file content (33 lines) | stat: -rw-r--r-- 494 bytes parent folder | download | duplicates (2)
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
#ifndef _PRINTF_H_
#define _PRINTF_H_

#include <progmem.h>
#include <io.h>

int printf (const char *fmt, ...);
int sprintf (char *buf, const char *fmt, ...);

extern void inline
init_send_byte ()
{
  outp (0x7f,DDRB);
}

/* call init_send_byte () first */
extern void send_byte (char);

extern inline void
send_str (char *s)
{
  while (*s)
    send_byte (*s++);
}

extern inline void
send_prgstr(prog_char * s)
{
  while (PRG_RDB (s))
    send_byte (PRG_RDB (s++));
}

#endif /* _PRINTF_H_ */