/***************************************************************************
 *             __________               __   ___.
 *   Open      \______   \ ____   ____ |  | _\_ |__   _______  ___
 *   Source     |       _//  _ \_/ ___\|  |/ /| __ \ /  _ \  \/  /
 *   Jukebox    |    |   (  <_> )  \___|    < | \_\ (  <_> > <  <
 *   Firmware   |____|_  /\____/ \___  >__|_ \|___  /\____/__/\_ \
 *                     \/            \/     \/    \/            \/
 * $Id: $
 *
 * Copyright (C) 2002 Philipp Pertermann
 *
 * All files in this archive are subject to the GNU General Public License.
 * See the file COPYING in the source tree root for full license agreement.
 *
 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
 * KIND, either express or implied. 
 *
 ****************************************************************************/

#include "menu.h"
#include "lcd.h"
#include "button.h"
#include "mas.h"
#include "system.h"
#include "oszillosgraph.h"

Menu oszillosgraph(void){
    int left, right, x, button;
    char buf[20];

    while (button_get_w_tmo(1) != BUTTON_OFF){
        for (x = 0; x< LCD_WIDTH; x++) {
            left = mas_codec_readreg(0xC);
            right = mas_codec_readreg(0xC);
            lcd_clearline(x, 0, x, LCD_HEIGHT);
            lcd_drawline(x, LCD_HEIGHT, x, LCD_HEIGHT - right / 1024);
            lcd_drawline(x, LCD_HEIGHT / 2, x, (LCD_HEIGHT / 2) - left/ 1024);
            lcd_update_rect(x - 1, 0, x + 1, LCD_HEIGHT);
        }
    }
    return MENU_OK;
}

