File: printf.h

package info (click to toggle)
avr-libc 1%3A1.2.3-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,816 kB
  • ctags: 14,018
  • sloc: ansic: 17,998; asm: 5,024; sh: 2,778; makefile: 712; pascal: 441
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_ */