mirror of https://github.com/contiki-ng/mspsim
Solve crash when using watchdog WDTIS=0
Change Watchdog delay value from int to long
This commit is contained in:
parent
d76b937b00
commit
bb77ef3fff
|
|
@ -59,8 +59,8 @@ public class Watchdog extends IOUnit implements SFRModule {
|
|||
private static final int WATCHDOG_INTERRUPT_BIT = 0;
|
||||
private static final int WATCHDOG_INTERRUPT_VALUE = 1 << WATCHDOG_INTERRUPT_BIT;
|
||||
|
||||
private static final int[] DELAY = {
|
||||
2*1024*1024*1024,128*1024*1024,8*1024*1024,512*1024,32768, 8192, 512, 64
|
||||
private static final long[] DELAY = {
|
||||
2*1024*1024*1024l,128*1024*1024,8*1024*1024,512*1024,32768, 8192, 512, 64
|
||||
};
|
||||
|
||||
private int resetVector = 15;
|
||||
|
|
@ -72,9 +72,9 @@ public class Watchdog extends IOUnit implements SFRModule {
|
|||
private boolean hold = false;
|
||||
|
||||
// The current "delay" when started/clered (or hold)
|
||||
private int delay;
|
||||
private long delay;
|
||||
// The target time for this timer
|
||||
private long targetTime;
|
||||
//private long targetTime;
|
||||
// Timer ACLK
|
||||
private boolean sourceACLK = false;
|
||||
|
||||
|
|
@ -170,10 +170,10 @@ public class Watchdog extends IOUnit implements SFRModule {
|
|||
private void scheduleTimer() {
|
||||
if (sourceACLK) {
|
||||
if (DEBUG) log("setting delay in ms (ACLK): " + 1000.0 * delay / cpu.aclkFrq);
|
||||
targetTime = cpu.scheduleTimeEventMillis(wdtTrigger, 1000.0 * delay / cpu.aclkFrq);
|
||||
cpu.scheduleTimeEventMillis(wdtTrigger, 1000.0 * delay / cpu.aclkFrq);
|
||||
} else {
|
||||
if (DEBUG) log("setting delay in cycles");
|
||||
cpu.scheduleCycleEvent(wdtTrigger, targetTime = cpu.cycles + delay);
|
||||
cpu.scheduleCycleEvent(wdtTrigger, cpu.cycles + delay);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ public class Exp5438Gui extends AbstractNodeGUI {
|
|||
};
|
||||
|
||||
public Exp5438Gui(Exp5438Node node) {
|
||||
super("MSPSIM fork by Prof. Rüdiger Heintz 0.4.19", "images/MSP-EXP430F5438.jpg");
|
||||
super("MSPSIM fork by Prof. Rüdiger Heintz 0.4.20", "images/MSP-EXP430F5438.jpg");
|
||||
this.node = node;
|
||||
Action scaleDownAction = new AbstractAction() {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
|
|
|||
Loading…
Reference in New Issue