--_003_5302439B6080902yahoocombr_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Indeed, this code is far from perfect. I wrote it "ad-hoc" from old memories. Although I did test it in MPLB IDE, it has some "FIXME". The version I'm sending attached to this e-mail is a little more elaborated, but far from bug-free. Best regards, Isaac Em 17/02/2014 12:38, Kerry Wentworth escreveu: > I know these are code fragments, but in your example, your TasksState[i]= =20 > is the sum of temp (16 bit return value) and t (32 bit timer ticks), so=20 > it needs to be unsigned long (32 bits), not a 16 bit int. > > Kerry > > > Isaac Marino Bavaresco wrote: >> The indirect function calls are just part of the package. You can use >> the macros and general structure even without the "scheduler", just some >> changes to the "Sleep" macro are needed. >> >> >> Isaac >> >> =20 --_003_5302439B6080902yahoocombr_ Content-Type: text/plain; name="C-R.c" Content-Description: C-R.c Content-Disposition: attachment; filename="C-R.c"; size=2879; creation-date="Mon, 17 Feb 2014 16:28:37 GMT"; modification-date="Mon, 17 Feb 2014 16:28:37 GMT" Content-Transfer-Encoding: base64 Lyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09Ki8NCiNpbmNsdWRlIDxwaWMuaD4NCi8qPT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PSovDQojZGVmaW5lCUJBU0lDX1RZQ0tfVFlQRQlsb25nDQoNCnR5cGVkZWYgdW5zaWdu ZWQgQkFTSUNfVFlDS19UWVBFCXRpY2tjb3VudF90Ow0KdHlwZWRlZiBzaWduZWQgQkFTSUNfVFlD S19UWVBFCQl0YXNrcmV0dXJuX3Q7DQoNCnZvbGF0aWxlIHRpY2tjb3VudF90CVN5c3RlbVRpY2sg PSAwOw0KDQovKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLw0KI2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mFyaWFibGVz IGFzIHN0YXRpYw0KCXN0YXRpYyBpbnQJajsNCg0KCVRhc2tTdGFydCgpOw0KDQoJd2hpbGUoIDEg KQ0KCQl7DQoJCS8vIERvIHNvbWV0aGluZy4uLg0KCQlZaWVsZCgpOw0KCQlmb3IoIGogPSAwOyBq IDwgMTA7IGorKyApDQoJCQl7DQoJCQkvLyBEbyBhbm90aGVyIHNvbWV0aGluZy4uLg0KCQkJYisr Ow0KCQkJWWllbGQoKTsNCgkJCX0NCgkJLy8gQW5kIHNvIG9uLi4uDQoJCVNsZWVwKCA1ICk7DQoJ CX0NCg0KCVRhc2tFbmQoKTsNCg0KCS8vIFdpbGwgbmV2ZXIgcmVhY2ggaGVyZQ0KCXJldHVybiAt MTsNCgl9DQoNCi8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovDQoNCnZvaWQgaW50ZXJydXB0IElTUigg dm9pZCApDQoJew0KCWlmKCBUTVIxSUUgJiYgVE1SMUlGICkNCgkJew0KCQlUTVIxSUYJPSAwOw0K CQlTeXN0ZW1UaWNrKys7DQoJCX0NCgkvLyBTZXJ2aWNlIG90aGVyIGludGVycnVwdHMuLi4NCgl9 DQoNCi8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PSovDQoNCnR5cGVkZWYgdGFza3JldHVybl90ICgqdGFz a3B0cl90KSggdm9pZCApOw0KDQpzaWduZWQgY2hhcglUYXNrc1N0YXRlW05VTV9UQVNLU10JPSB7 IDAsIDAgfTsNCnRpY2tjb3VudF90CVRhc2tzRGVsYXlbTlVNX1RBU0tTXQk9IHsgMCwgMCB9Ow0K dGFza3B0cl90CVRhc2tzW05VTV9UQVNLU10JCT0geyBUYXNrMSwgVGFzazIgfTsNCg0KLyo9PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09Ki8NCg0KaW50IG1haW4oIHZvaWQgKQ0KCXsNCgl0aWNrY291bnRfdAkJ dDsNCgl0YXNrcmV0dXJuX3QJdGVtcDsNCglpbnQJCQkJaQk9IDA7DQoNCgkvLyBJbml0aWFsaXpl IHRoaW5ncy4uLg0KCVRNUjEJPSAwOw0KCVRNUjFJRgk9IDA7DQoJVE1SMUlFCT0gMTsNCglQRUlF CT0gMTsNCglHSUUJCT0gMTsNCglUTVIxT04JPSAxOw0KDQoJd2hpbGUoIDEgKQ0KCQl7DQoJCWZv ciggaSA9IDA7IGkgPCBOVU1fVEFTS1M7IGkrKyApDQoJCQl7DQoJCQlDTFJXRFQoKTsNCgkJCUdJ RQk9IDA7DQoJCQl0CT0gU3lzdGVtVGljazsNCgkJCUdJRQk9IDE7DQoJCQlpZiggVGFza3NTdGF0 ZVtpXSA9PSAwIHx8IFRhc2tzU3RhdGVbaV0gPiAwICYmICh0YXNrcmV0dXJuX3QpKCBUYXNrc0Rl bGF5W2ldIC0gdCApIDw9IDAgKQ0KCQkJCXsNCgkJCQl0ZW1wID0gVGFza3NbaV0oKTsNCgkJCQlp ZiggdGVtcCA+IDAgKQ0KCQkJCQl7DQoJCQkJCVRhc2tzU3RhdGVbaV0JPSAxOw0KCQkJCQlUYXNr c0RlbGF5W2ldCT0gdGVtcCArIHQ7DQoJCQkJCX0NCgkJCQllbHNlDQoJCQkJCVRhc2tzU3RhdGVb aV0JPSAoc2lnbmVkIGNoYXIpdGVtcDsNCgkJCQl9DQoJCQl9CQkgICANCgkJfQ0KCX0NCg0KLyo9 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09Ki8NCg== --_003_5302439B6080902yahoocombr_ Content-Type: text/plain; name="ATT00001.txt" Content-Description: ATT00001.txt Content-Disposition: attachment; filename="ATT00001.txt"; size=224; creation-date="Mon, 17 Feb 2014 16:28:37 GMT"; modification-date="Mon, 17 Feb 2014 16:28:37 GMT" Content-Transfer-Encoding: base64 LS0gDQpodHRwOi8vd3d3LnBpY2xpc3QuY29tL3RlY2hyZWYvcGljbGlzdCBQSUMvU1ggRkFRICYg bGlzdCBhcmNoaXZlDQpWaWV3L2NoYW5nZSB5b3VyIG1lbWJlcnNoaXAgb3B0aW9ucyBhdA0KaHR0 cDovL21haWxtYW4ubWl0LmVkdS9tYWlsbWFuL2xpc3RpbmZvL3BpY2xpc3QNCg== --_003_5302439B6080902yahoocombr_-- .