Objects out of scope
Paul
Posts: 263
I have a program that has two objects:
OBJ
BS2: "BS2Functions" and
SNMP: "SNMP".
I found I need to call a BS2 function (SHIFTOUT) from the SNMP object. The manual indicates this is out of scope.
Whats the best way around this? Add another BS2Function object to SNMP object?
I can't actually do this because SNMP has FullDuplexSerial as an object and there are conflicts about DEBUG pins.
How about copy and paste just the SHIFTOUT code into SNMP? (too kludgy?)
stumped again.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki Rocks! - propeller.wikispaces.com
OBJ
BS2: "BS2Functions" and
SNMP: "SNMP".
I found I need to call a BS2 function (SHIFTOUT) from the SNMP object. The manual indicates this is out of scope.
Whats the best way around this? Add another BS2Function object to SNMP object?
I can't actually do this because SNMP has FullDuplexSerial as an object and there are conflicts about DEBUG pins.
How about copy and paste just the SHIFTOUT code into SNMP? (too kludgy?)
stumped again.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki Rocks! - propeller.wikispaces.com
Comments
Doesn't the conflict only arise if you try to use the conflicting resources and isn't that potentially the case anyway should SNMP and BS2Function compete ?
The only problem you're likely to have is if you need interaction between the top-most BS2Function and the BS2Function which is a sub-object of SNMP. That depends on how BS2Function is coded but if what you need to call is a self-contained, standalone method there shouldn't be any problems.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·"I have always wished that my computer would be as easy to use as my telephone.· My wish has come true.· I no longer know how to use my telephone."
- Bjarne Stroustrup
Yes there was a conflict because I usually ran some 'debug' statements in both the main and SNMP modules. things would get clobbered sometimes.
I've copied the SHIFTOUT to a local PUB and added the associated constants. Everything is working ok.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki Rocks! - propeller.wikispaces.com