head	1.4;
access;
symbols
	bg2_23:1.4
	bg2_22:1.4
	bg2_21:1.4
	bg2_20:1.4
	bg2_16:1.4
	bg2_15:1.4
	bg2_12:1.4
	bg2_07:1.4
	isorc2008_submission:1.3
	handbook_alpha_edition:1.3
	jtres2007_submission:1.3
	bg1_07:1.3
	bg1_06:1.3
	bg1_05:1.3
	TAL_101:1.3
	TAL_100:1.3
	jtres_submission:1.3
	wises06_submission:1.3
	lctes2006_submission:1.3
	rtgc_isorc2006:1.3.0.4
	isorc2006:1.3.0.2
	rtgc_paper:1.3
	bg1_00:1.3
	nohandle:1.3
	thesis:1.2
	arelease:1.1.1.1
	avendor:1.1.1;
locks; strict;
comment	@# @;


1.4
date	2008.02.25.14.06.20;	author martin;	state Exp;
branches;
next	1.3;
commitid	710147c2cb5b4567;

1.3
date	2005.05.11.16.18.33;	author martin;	state Exp;
branches;
next	1.2;
commitid	566d42822fd54567;

1.2
date	2004.09.10.07.49.01;	author martin;	state Exp;
branches;
next	1.1;

1.1
date	2004.02.19.13.21.14;	author martin;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	2004.02.19.13.21.14;	author martin;	state Exp;
branches;
next	;


desc
@@


1.4
log
@JOP goes GPL
@
text
@/*
  This file is part of JOP, the Java Optimized Processor
    see <http://www.jopdesign.com/>

  Copyright (C) 2001-2008, Martin Schoeberl (martin@@jopdesign.com)

  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 3 of the License, or
  (at your option) any later version.

  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, see <http://www.gnu.org/licenses/>.
*/

/*
 *
 */

package ossi;

/**
*	Main.java: test main.
*
*	Author: Martin Schoeberl (martin.schoeberl@@chello.at)
*
*/

import joprt.RtThread;
import util.Dbg;
import util.Timer;

import com.jopdesign.sys.Const;
import com.jopdesign.sys.Native;

/**
*	Test Main for ejip.
*/

public class Main {

/**
*	Start network and enter forever loop.
*/
	public static void main(String[] args) {

		// Dbg.init();
		Dbg.initSer();

		//
		//	start TCP/IP and all (four) threads
		//
		// Net.init();
		//
		//	start device driver threads
		//
// don't use CS8900 when simulating on PC or for BG263
		// LinkLayer ipLink = CS8900.init(Net.eth, Net.ip);
// don't use PPP on my web server
		// Ppp.init(); 
		// LinkLayer ipLink = Slip.init((192<<24) + (168<<16) + (1<<8) + 2); 


		//
		//	Start RST and Pwm thread
		//
		RST.init();
		Pwm.init();

		//
		//	WD thread has lowest priority to see if every timing will be met
		//

		RtThread.startMission();

/* read ID  and status from NAND
Dbg.wr('\n');
// Native.wrMem(0xff, 0x100001);
Native.wrMem(0x90, 0x100001);
Native.wrMem(0x00, 0x100002);
//
//	should read 0x98 and 0x73
//
Dbg.hexVal(Native.rdMem(0x100000));
Dbg.hexVal(Native.rdMem(0x100000));

//
//	read status, should be 0xc0
//
Native.wrMem(0x70, 0x100001);
Dbg.hexVal(Native.rdMem(0x100000));
Dbg.hexVal(Native.rdMem(0x100000));
*/

/* Read ID from Flash
Native.wrMem(0xaa, 0x80555);
Native.wrMem(0x55, 0x802aa);
Native.wrMem(0x90, 0x80555);
Dbg.hexVal(Native.rdMem(0x80000));
Native.wrMem(0xaa, 0x80555);
Native.wrMem(0x55, 0x802aa);
Native.wrMem(0x90, 0x80555);
Dbg.hexVal(Native.rdMem(0x80001));
*/

		forever();
	}

	private static void forever() {

		//
		//	just do the WD blink with lowest priority
		//	=> if the other threads take to long (*3) there will be a reset
		//
		for (;;) {
			for (int i=0; i<10; ++i) {
				RtThread.sleepMs(50);
				int val = Native.rd(Const.IO_IN);
				Native.wr(val, Const.IO_LED);
			}
			Timer.wd();
		}
	}
}
@


1.3
log
@resync with current development
@
text
@d2 20
@


1.2
log
@resync of actual development.
@
text
@d14 3
a16 2
import util.*;
import joprt.*;
@


1.1
log
@Initial revision
@
text
@a13 1
import ejip.*;
d17 1
a30 1
		Timer.init(20000000, 5);	// just for the watch dog or some usleep (where ?)
d102 2
a103 2
				int val = Native.rd(Native.IO_IN);
				Native.wr(val, Native.IO_LED);
@


1.1.1.1
log
@initial cvs import.
@
text
@@
