mirror of https://github.com/contiki-ng/mspsim
added notification of configuration change for CC2420
git-svn-id: https://mspsim.svn.sourceforge.net/svnroot/mspsim/mspsim@759 23d1a52b-0c3c-0410-b72d-8f29ab48fe35
This commit is contained in:
parent
97b7984c94
commit
1cbd5410e5
|
|
@ -661,6 +661,7 @@ public class CC2420 extends Chip implements USARTListener, RFListener, RFSource
|
|||
}
|
||||
|
||||
private void setReg(int address, int data) {
|
||||
int oldValue = registers[address];
|
||||
registers[address] = data;
|
||||
switch(address) {
|
||||
case REG_IOCFG0:
|
||||
|
|
@ -682,12 +683,13 @@ public class CC2420 extends Chip implements USARTListener, RFListener, RFSource
|
|||
autoAck = (data & AUTOACK) != 0;
|
||||
break;
|
||||
case REG_FSCTRL:
|
||||
if (cl != null) {
|
||||
updateActiveFrequency();
|
||||
cl.changedChannel(activeChannel);
|
||||
}
|
||||
if (cl != null) {
|
||||
updateActiveFrequency();
|
||||
cl.changedChannel(activeChannel);
|
||||
}
|
||||
break;
|
||||
}
|
||||
configurationChanged(address, oldValue, data);
|
||||
}
|
||||
|
||||
public void dataReceived(USART source, int data) {
|
||||
|
|
|
|||
|
|
@ -181,7 +181,7 @@ public abstract class Chip implements Loggable, EventSource {
|
|||
/* Called by subclasses to inform about changes of configuration */
|
||||
protected void configurationChanged(int parameter, int oldValue, int newValue) {
|
||||
ConfigurationChangeListener[] listeners = ccListeners;
|
||||
if (listeners != null) {
|
||||
if (oldValue != newValue && listeners != null) {
|
||||
for (int i = 0, n = listeners.length; i < n; i++) {
|
||||
listeners[i].configurationChanged(this, parameter, oldValue, newValue);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue