Subversion Repositories Projects

Rev

Blame | Last modification | View Log | RSS feed

/*****************************************************************************
 *   Copyright (C) 2010 Peter "woggle" Mack, mac@denich.net                  *
 *                                                                           *
 *   This program is free software; you can redistribute it and/or modify    *
 *   it under the terms of the GNU General Public License as published by    *
 *   the Free Software Foundation; either version 2 of the License.          *
 *                                                                           *
 *   This program is distributed in the hope that it will be useful,         *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of          *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the           *
 *   GNU General Public License for more details.                            *
 *                                                                           *
 *   You should have received a copy of the GNU General Public License       *
 *   along with this program; if not, write to the                           *
 *   Free Software Foundation, Inc.,                                         *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.               *
 *                                                                           *
 *****************************************************************************/


#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/pgmspace.h>

#include "lcd.h"
#include "timer.h"      // Keys
#include "usart.h"
#include "status.h"
#include "debug.h"


//*****************************************************************************
//
void status (void)
{
        uint8_t line = 1;

        lcd_cls ();
       
        lcd_printp (PSTR("Status:"), 0);
        lcd_printpns_at (0, 7, PSTR("            Back    "), 0);
       
        lcd_printp_at(0, line, PSTR("MMB Version: "), 0);
        lcd_write_number_u (VERSION_MAJOR);
        lcd_printp(PSTR("."), 0);
        lcd_write_number_u (VERSION_MINOR);
        line++;
       
        lcd_printp_at(0, line, PSTR("UART CRC ERR: "), 0);
        write_ndigit_number_u(15, line, stat_crc_error, 5, 0);
        line++;
       
        lcd_printp_at(0, line, PSTR("UART OVEFLOW: "), 0);
        write_ndigit_number_u(15, line, stat_overflow_error, 5, 0);
        line++;
       
#if defined (__AVR_ATmega32__)
        lcd_printp_at(0, line, PSTR("Names: "), 0);
        write_ndigit_number_u(15, line, AnalogNamesRead, 5, 0);
        line++;
#else
        lcd_printp_at(0, line, PSTR("Names NC: "), 0);
        write_ndigit_number_u(15, line, AnalogNamesRead[0], 5, 0);
        line++;

        lcd_printp_at(0, line, PSTR("AN FC: "), 0);
        write_ndigit_number_u(15, line, AnalogNamesRead[1], 5, 0);
        line++;
#endif
       
        while (!get_key_press (1 << KEY_ESC));
}