/************************************************************************

        Title: MIRSVシステム Ledの表示
        
        File : DISP.C           Ver.1.0  written on Jan.26,1996 by J.W.
                                Ver.1.1             Feb.5,1996
                                
*************************************************************************/
#include "m9401.h"
#include "mathf.h"


extern int Led1; /* Green Led Data */
extern int Led2; /* Red Led Data */
extern int Seg[];/* 7seg_led Data (1-4) */
extern int Tmc;
extern int mode;
extern int Posi;
extern int Act;

int disp()
{
        int led_d;
        int i;

        if(mode==PS_MODE){
                Led1=ON;
                Led2=OFF;
        }
        else {
                Led1=OFF;
                Led2=ON;
        }
        Seg[4]=mode;
        Seg[3]=Posi;
        Seg[2]=Act;
        Seg[0]=Seg[4];
        for(i=1;i<=4;i++){
                led_d=((Led1<<7) | (Led2<<6) | (i-1<<4) | Seg[i-1]);
                outportb(LED,led_d);
                led_d=((Led1<<7) | (Led2<<6) | (i-1<<4) | Seg[i]);
                outportb(LED,led_d);
        }       
}