cons.h
author darius@Inchoate
Mon, 19 Jan 2009 22:54:19 +1030
changeset 71 553c061fda7c
permissions -rw-r--r--
Keep the newer GCC happy.
darius@41
     1
/*
darius@41
     2
 * Console code headers
darius@41
     3
 *
darius@41
     4
 * Copyright (c) 2008
darius@41
     5
 *      Daniel O'Connor <darius@dons.net.au>.  All rights reserved.
darius@41
     6
 *
darius@41
     7
 * Redistribution and use in source and binary forms, with or without
darius@41
     8
 * modification, are permitted provided that the following conditions
darius@41
     9
 * are met:
darius@41
    10
 * 1. Redistributions of source code must retain the above copyright
darius@41
    11
 *    notice, this list of conditions and the following disclaimer.
darius@41
    12
 * 2. Redistributions in binary form must reproduce the above copyright
darius@41
    13
 *    notice, this list of conditions and the following disclaimer in the
darius@41
    14
 *    documentation and/or other materials provided with the distribution.
darius@41
    15
 *
darius@41
    16
 * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
darius@41
    17
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
darius@41
    18
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
darius@41
    19
 * ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
darius@41
    20
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
darius@41
    21
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
darius@41
    22
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
darius@41
    23
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
darius@41
    24
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
darius@41
    25
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
darius@41
    26
 * SUCH DAMAGE.
darius@41
    27
 */
darius@41
    28
darius@41
    29
typedef volatile struct {
darius@41
    30
    char	buf[40];
darius@41
    31
    uint8_t	state;
darius@41
    32
    uint8_t	len;
darius@41
    33
} consbuf_t;
darius@41
    34
darius@41
    35
extern consbuf_t cmd;
darius@41
    36
darius@41
    37
void		cons_init(void);
darius@41
    38
void		cons_putsP(const char *addr);
darius@41
    39
void		cons_puts(const char *addr);
darius@41
    40
int		cons_putc(char c);
darius@41
    41
void		cons_puts_dec(uint8_t a, uint8_t l);
darius@41
    42
void		cons_puts_hex(uint8_t a);
darius@41
    43
char		cons_getc(void);
darius@41
    44