mbed-src updated for BMD-200 evaluation board. Just pin numbers are updated.
Dependents: mbed_blinky-bmd-200 bmd-200_accel_demo firstRig
Fork of mbed-src by
Replacement for the "mbed" or "mbed-src" library when using the BMD-200 Evaluation kit. This library only remaps the pin names (i.e. LED1 points to p0.01 instead of p0.18, etc) as used by the BMD-200 Evaluation board (select the nRF51822_mkit platform). All other code is untouched.
Diff: common/TimerEvent.cpp
- Revision:
- 529:c320967f86b9
- Parent:
- 304:89b9c3a9a045
--- a/common/TimerEvent.cpp Mon Apr 27 09:45:08 2015 +0100 +++ b/common/TimerEvent.cpp Tue Apr 28 11:45:12 2015 +0100 @@ -17,11 +17,17 @@ #include "cmsis.h" #include <stddef.h> +#include "ticker_api.h" +#include "us_ticker_api.h" namespace mbed { -TimerEvent::TimerEvent() : event() { - us_ticker_set_handler((&TimerEvent::irq)); +TimerEvent::TimerEvent() : event(), _ticker_data(get_us_ticker_data()) { + ticker_set_handler(_ticker_data, (&TimerEvent::irq)); +} + +TimerEvent::TimerEvent(const ticker_data_t *data) : event(), _ticker_data(data) { + ticker_set_handler(_ticker_data, (&TimerEvent::irq)); } void TimerEvent::irq(uint32_t id) { @@ -35,11 +41,11 @@ // insert in to linked list void TimerEvent::insert(timestamp_t timestamp) { - us_ticker_insert_event(&event, timestamp, (uint32_t)this); + ticker_insert_event(_ticker_data, &event, timestamp, (uint32_t)this); } void TimerEvent::remove() { - us_ticker_remove_event(&event); + ticker_remove_event(_ticker_data, &event); } } // namespace mbed