JVM test

Dependencies:   mbed

Revision:
8:d9e205196dfc
Parent:
7:2a384a077520
Child:
9:4ea7773ea2b0
diff -r 2a384a077520 -r d9e205196dfc device_depend.cpp
--- a/device_depend.cpp	Thu Aug 29 13:31:23 2013 +0000
+++ b/device_depend.cpp	Thu Aug 29 14:15:47 2013 +0000
@@ -4,7 +4,7 @@
 
 #define bc_str_length 1024 // from 32 to 1024
 
-
+BusInOut ledport(LED1, LED2, LED3, LED4);
 Serial pc(USBTX, USBRX); // tx, rx
 LocalFileSystem local("local");
 FILE* ReadFile;
@@ -16,6 +16,7 @@
 
 void hardware_init(void){
 	setup_systick();
+	ledport.output();
 }
 
 void uart_print(char *str){
@@ -36,7 +37,14 @@
 }
 
 void port_write(int port, int bit, int value){
-	//bit = value;
+	if((bit < 0)||(bit > 3))return;
+	int i = ledport;
+	if(value)
+		i |= (1 << bit);
+	else
+		i &= ~(1 << bit);
+	
+	ledport = i; 
 	return;
 }