/*
    Hello.c : Reads library version and flash memory size.
    
    Compiler: BC++ 3.1, 
              Turbo C ++ 1.01(3.01) (free from http://community.borland.com/museum)
              MSC 6.0,
              MSVC 1.52.
              
    Compile mode: large
    
    Project: Hello.c
             ..\Lib\(8000E.Lib,7188XAL.Lib,7188XBL.Lib,7188XL.Lib or 7188EL.Lib) 
    
    Detail description:
        User can use MiniOs utility to load hello.exe to 7188XA/7188XB/7188XC/8000.
    
    Hardware: 7188/8000
    
[24 May,2005] by Bill 
*/

#include"..\..\lib\vh2k.h"

void main(void)
{ 
    int iType,iVer;
    int ReadInit;
    InitLib();

    iType=IsMiniOS7();
    Print("Hello MiniOS! (Flash memory is %d K)\n\r",iType);
    if(iType)
    {
        iVer=GetLibVersion();
        Print("Hello MiniOS! (Flash memory is %d K)\n\r",iType);
        Print("Library version is %d.%02d\n\r\n\r",iVer>>8,iVer&0xff);
        if (FlashGetWpStatus())
        	Print ("Flash is in Write-Protected mode \n\r");
        else 
        	Print ("Flash is in Write-Enabled mode \n\r");
        	
       ReadInit = ReadInitPin();//Get Init Pin
       Print("Init Pin Value = %d\n\r",ReadInit);
       if (ReadInit==0)
       	 	Print("Now is not Init Mode ,Init Pin Value = %d\n\r",ReadInit);
       else if (ReadInit==1)
       		Print("Now is Init Mode ,Init Pin Value = %d\n\r",ReadInit);
       else
       		Print("Get Init Pin value error ,Init Pin Value = %d\n\r",ReadInit);
    }
    else
    {
        Print("Hello PC!, this program is not run under 8000.");
    }
}   
    