JVM test

Dependencies:   mbed

Revision:
5:047542b65d00
Child:
6:b9d0d96b052f
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/device_depend.cpp	Sat Aug 24 07:00:51 2013 +0000
@@ -0,0 +1,47 @@
+#include <stdio.h>
+#include <string.h>
+#include "device_depend.h"
+
+
+volatile static unsigned long msTicks;                            /* counts 1ms timeTicks */
+
+Serial pc(USBTX, USBRX); // tx, rx
+Ticker tick;
+void hardware_init(void){
+	setup_systick();
+}
+
+void uart_print(char *str){
+	pc.printf(str);
+	return;
+}
+
+void uart_init(int baud_rate){
+	
+}
+
+int uart_read(void){
+	return pc.getc();
+}
+
+int time_millis(void){
+	return msTicks;
+}
+
+void port_write(int port, int bit, int value){
+	//bit = value;
+}
+
+
+/*----------------------------------------------------------------------------
+  SysTick_Handler
+ *----------------------------------------------------------------------------*/
+void SysTickCount(void) {
+  msTicks++;                        /* increment counter necessary in Delay() */
+}
+
+void setup_systick (void) {
+	msTicks = 0;
+	tick.attach_us(&SysTickCount, 1000); //set 32kHz/8(word FIFO) sampling data	}
+}
+