Andy Lustig
/
stateScript_v2
fork of StateScript
Fork of stateScript_v2 by
main.cpp@10:f65649c13b5b, 2017-04-28 (annotated)
- Committer:
- alustig3
- Date:
- Fri Apr 28 14:47:55 2017 +0000
- Revision:
- 10:f65649c13b5b
- Parent:
- 0:8dbd6bd9167f
Code is now compatible with FRDM-K64F.; Replaced SMARTWAV with SOMO-II
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mkarlsso | 0:8dbd6bd9167f | 1 | #include "behave.h" |
mkarlsso | 0:8dbd6bd9167f | 2 | |
alustig3 | 10:f65649c13b5b | 3 | #ifdef K64HARDWARE |
alustig3 | 10:f65649c13b5b | 4 | extern uint32_t timeKeeper; //the master clock |
alustig3 | 10:f65649c13b5b | 5 | extern bool resetTimer; |
alustig3 | 10:f65649c13b5b | 6 | void tick(){ |
alustig3 | 10:f65649c13b5b | 7 | timeKeeper++; |
alustig3 | 10:f65649c13b5b | 8 | if (resetTimer){ |
alustig3 | 10:f65649c13b5b | 9 | timeKeeper = 0; |
alustig3 | 10:f65649c13b5b | 10 | resetTimer = false; |
alustig3 | 10:f65649c13b5b | 11 | } |
alustig3 | 10:f65649c13b5b | 12 | } |
alustig3 | 10:f65649c13b5b | 13 | Ticker keeptime; |
alustig3 | 10:f65649c13b5b | 14 | |
alustig3 | 10:f65649c13b5b | 15 | int main() { |
alustig3 | 10:f65649c13b5b | 16 | keeptime.attach_us(&tick,1000); |
alustig3 | 10:f65649c13b5b | 17 | #else |
mkarlsso | 0:8dbd6bd9167f | 18 | using namespace std; |
mkarlsso | 0:8dbd6bd9167f | 19 | |
mkarlsso | 0:8dbd6bd9167f | 20 | int main() { |
alustig3 | 10:f65649c13b5b | 21 | #endif |
mkarlsso | 0:8dbd6bd9167f | 22 | mainLoop m; |
mkarlsso | 0:8dbd6bd9167f | 23 | m.init(); |
mkarlsso | 0:8dbd6bd9167f | 24 | m.exec(); |
mkarlsso | 0:8dbd6bd9167f | 25 | } |