From: <jo...@us...> - 2007-11-19 10:29:38
|
Revision: 25 http://mspsim.svn.sourceforge.net/mspsim/?rev=25&view=rev Author: joxe Date: 2007-11-19 02:29:23 -0800 (Mon, 19 Nov 2007) Log Message: ----------- added very simple sky firmware Modified Paths: -------------- mspsim/Makefile mspsim/se/sics/mspsim/platform/sky/SkyGui.java mspsim/se/sics/mspsim/platform/sky/SkyNode.java Added Paths: ----------- mspsim/firmware/sky/ mspsim/firmware/sky/blink.firmware Modified: mspsim/Makefile =================================================================== --- mspsim/Makefile 2007-11-05 09:35:29 UTC (rev 24) +++ mspsim/Makefile 2007-11-19 10:29:23 UTC (rev 25) @@ -54,7 +54,7 @@ ifndef FIRMWAREFILE ESBFIRMWARE = firmware/esb/sensor-demo.firmware -SKYFIRMWARE = firmware/sky/sensor-demo.firmware +SKYFIRMWARE = firmware/sky/blink.firmware else ESBFIRMWARE = $FIRMWAREFILE SKYFIRMWARE = $FIRMWAREFILE Added: mspsim/firmware/sky/blink.firmware =================================================================== (Binary files differ) Property changes on: mspsim/firmware/sky/blink.firmware ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: mspsim/se/sics/mspsim/platform/sky/SkyGui.java =================================================================== --- mspsim/se/sics/mspsim/platform/sky/SkyGui.java 2007-11-05 09:35:29 UTC (rev 24) +++ mspsim/se/sics/mspsim/platform/sky/SkyGui.java 2007-11-19 10:29:23 UTC (rev 25) @@ -58,15 +58,18 @@ public class SkyGui extends JComponent implements KeyListener, MouseMotionListener { - public static final int GREEN_Y = 34; + public static final int GREEN_Y = 39; public static final int BLUE_Y = 47; + public static final int RED_Y = 34; public static final int LED_X = 10; public static final Color BLUE_TRANS = new Color(0x40,0x40,0xff,0xa0); public static final Color GREEN_TRANS = new Color(0x40, 0xf0, 0x40, 0xa0); + public static final Color RED_TRANS = new Color(0xf0, 0x40, 0x40, 0xa0); public static final Color BLUE_C = new Color(0xff8080ff); public static final Color GREEN_C = new Color(0xff60ff60); + public static final Color RED_C = new Color(0xffff8000); private SerialMon serial; private SerialMon radio; @@ -133,6 +136,12 @@ } // Display all active leds + if (node.redLed) { + g.setColor(RED_TRANS); + g.fillOval(LED_X - 2, RED_Y - 1, 9, 5); + g.setColor(RED_C); + g.fillOval(LED_X, RED_Y, 4, 3); + } if (node.greenLed) { g.setColor(GREEN_TRANS); g.fillOval(LED_X - 2, GREEN_Y - 1, 9, 5); Modified: mspsim/se/sics/mspsim/platform/sky/SkyNode.java =================================================================== --- mspsim/se/sics/mspsim/platform/sky/SkyNode.java 2007-11-05 09:35:29 UTC (rev 24) +++ mspsim/se/sics/mspsim/platform/sky/SkyNode.java 2007-11-19 10:29:23 UTC (rev 25) @@ -65,13 +65,16 @@ private IOPort port1; private IOPort port2; private IOPort port4; + private IOPort port5; private CC2420 radio; private ExtFlash flash; - public static final int BLUE_LED = 0x01; - public static final int GREEN_LED = 0x02; + public static final int BLUE_LED = 0x40; + public static final int GREEN_LED = 0x20; + public static final int RED_LED = 0x10; + public boolean redLed; public boolean blueLed; public boolean greenLed; @@ -82,11 +85,10 @@ */ public SkyNode(MSP430 cpu) { this.cpu = cpu; - IOUnit unit = cpu.getIOUnit("Port 2"); + IOUnit unit = cpu.getIOUnit("Port 5"); if (unit instanceof IOPort) { - port2 = (IOPort) unit; - System.out.println("Found port 2!!!"); - port2.setPortListener(this); + port5 = (IOPort) unit; + port5.setPortListener(this); } unit = cpu.getIOUnit("Port 1"); @@ -124,7 +126,8 @@ public void portWrite(IOPort source, int data) { - if (source == port2) { + if (source == port5) { + redLed = (data & RED_LED) == 0; blueLed = (data & BLUE_LED) == 0; greenLed = (data & GREEN_LED) == 0; if (gui != null) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |