summaryrefslogtreecommitdiffstats
path: root/app/bits.c
blob: 3fe7833433fa806c1baaebf9324d762f48146ace (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include "project.h"

void dump_bits (char *wot, uint8_t *bits)
{
  char buf[128];
  char *ptr = buf;
  unsigned i = 60;


  ptr += sprintf (buf, "%s bits: ", wot);


  while (i--)
    * (ptr++) = * (bits++) ? '1' : '0';


  * (ptr++) = '\r';
  * (ptr++) = '\n';
  *ptr = 0;
  usart2_write (buf, (unsigned) (ptr - buf), 1);

}