mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-12-23 01:29:33 +00:00
three patches to simplify loading TinyOS firmwares (via MSPSim), contributed by Philipp Sommer
This commit is contained in:
parent
03605a568c
commit
df8cc48739
@ -26,7 +26,7 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: MspCompileDialog.java,v 1.1 2009/12/02 16:27:32 fros4943 Exp $
|
* $Id: MspCompileDialog.java,v 1.2 2010/03/08 14:26:12 fros4943 Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package se.sics.cooja.mspmote;
|
package se.sics.cooja.mspmote;
|
||||||
@ -40,6 +40,7 @@ import se.sics.cooja.Simulation;
|
|||||||
import se.sics.cooja.dialogs.AbstractCompileDialog;
|
import se.sics.cooja.dialogs.AbstractCompileDialog;
|
||||||
|
|
||||||
public class MspCompileDialog extends AbstractCompileDialog {
|
public class MspCompileDialog extends AbstractCompileDialog {
|
||||||
|
private static final long serialVersionUID = -7273193946433145019L;
|
||||||
private String target;
|
private String target;
|
||||||
|
|
||||||
public static boolean showDialog(
|
public static boolean showDialog(
|
||||||
@ -79,6 +80,9 @@ public class MspCompileDialog extends AbstractCompileDialog {
|
|||||||
if (file.getName().endsWith("." + target)) {
|
if (file.getName().endsWith("." + target)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
if (file.getName().equals("main.exe")) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: MspMoteID.java,v 1.15 2010/02/05 08:44:57 fros4943 Exp $
|
* $Id: MspMoteID.java,v 1.16 2010/03/08 14:26:12 fros4943 Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package se.sics.cooja.mspmote.interfaces;
|
package se.sics.cooja.mspmote.interfaces;
|
||||||
@ -198,16 +198,33 @@ public class MspMoteID extends MoteID {
|
|||||||
if (moteMem.variableExists("rseed")) {
|
if (moteMem.variableExists("rseed")) {
|
||||||
moteMem.setIntValueOf("rseed", (int) (mote.getSimulation().getRandomSeed() + newID));
|
moteMem.setIntValueOf("rseed", (int) (mote.getSimulation().getRandomSeed() + newID));
|
||||||
}
|
}
|
||||||
moteMem.setIntValueOf("TOS_NODE_ID", newID);
|
|
||||||
moteMem.setIntValueOf("ActiveMessageAddressC$addr", newID);
|
if (moteMem.variableExists("TOS_NODE_ID")) {
|
||||||
|
moteMem.setIntValueOf("TOS_NODE_ID", newID);
|
||||||
|
}
|
||||||
|
if (moteMem.variableExists("ActiveMessageAddressC__addr")) {
|
||||||
|
moteMem.setIntValueOf("ActiveMessageAddressC__addr", newID);
|
||||||
|
}
|
||||||
|
if (moteMem.variableExists("ActiveMessageAddressC$addr")) {
|
||||||
|
moteMem.setIntValueOf("ActiveMessageAddressC$addr", newID);
|
||||||
|
}
|
||||||
|
|
||||||
setChanged();
|
setChanged();
|
||||||
notifyObservers();
|
notifyObservers();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (location == ID_LOCATION.VARIABLE_TOS_NODE_ID) {
|
if (location == ID_LOCATION.VARIABLE_TOS_NODE_ID) {
|
||||||
moteMem.setIntValueOf("TOS_NODE_ID", newID);
|
if (moteMem.variableExists("TOS_NODE_ID")) {
|
||||||
moteMem.setIntValueOf("ActiveMessageAddressC$addr", newID);
|
moteMem.setIntValueOf("TOS_NODE_ID", newID);
|
||||||
|
}
|
||||||
|
if (moteMem.variableExists("ActiveMessageAddressC__addr")) {
|
||||||
|
moteMem.setIntValueOf("ActiveMessageAddressC__addr", newID);
|
||||||
|
}
|
||||||
|
if (moteMem.variableExists("ActiveMessageAddressC$addr")) {
|
||||||
|
moteMem.setIntValueOf("ActiveMessageAddressC$addr", newID);
|
||||||
|
}
|
||||||
|
|
||||||
setChanged();
|
setChanged();
|
||||||
notifyObservers();
|
notifyObservers();
|
||||||
return;
|
return;
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: AbstractCompileDialog.java,v 1.8 2009/10/28 12:02:21 fros4943 Exp $
|
* $Id: AbstractCompileDialog.java,v 1.9 2010/03/08 14:26:12 fros4943 Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package se.sics.cooja.dialogs;
|
package se.sics.cooja.dialogs;
|
||||||
@ -205,7 +205,7 @@ public abstract class AbstractCompileDialog extends JDialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getDescription() {
|
public String getDescription() {
|
||||||
return "Contiki process source or Contiki firmware";
|
return "Contiki process source or Precompiled firmware";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
fc.setDialogTitle("Select Contiki process source");
|
fc.setDialogTitle("Select Contiki process source");
|
||||||
|
Loading…
Reference in New Issue
Block a user