stock mbed AnalogReads current loop closed and working
Fork of priustroller_2 by
Diff: context.cpp
- Revision:
- 42:e4f35ff78d91
- Parent:
- 36:11766b5da6ed
- Child:
- 46:bd39f7e6e37f
--- a/context.cpp Thu Apr 16 22:24:37 2015 +0000 +++ b/context.cpp Thu Apr 16 22:55:21 2015 +0000 @@ -8,10 +8,14 @@ float debug_registers[32]; -Context::Context() { +Context::Context(bool timed) { _index = 0; - _time_upd_ticker = new Ticker(); - _time_upd_ticker->attach_us(this, &Context::upd_function, 50); + if (timed) { + _time_upd_ticker = new Ticker(); + _time_upd_ticker->attach_us(this, &Context::upd_function, 50); + } else { + _time_upd_ticker = NULL; + } } void Context::ConfigureOutputs(PinName oa, PinName ob, PinName oc, PinName en) { @@ -73,6 +77,8 @@ } void Context::Start() { + if (_time_upd_ticker == NULL) return; + InitData(); for (;;) {