RTno is communicating library and framework which allows you to make your embedded device capable of communicating with RT-middleware world. RT-middleware is a platform software to realize Robotic system. In RTM, robots are developed by constructing robotics technologies\' elements (components) named RT-component. Therefore, the RTno helps you to create your own RT-component with your mbed and arduino. To know how to use your RTno device, visit here: http://ysuga.net/robot_e/rtm_e/rtc_e/1065?lang=en To know about RT-middleware and RT-component, visit http://www.openrtm.org
Dependencies: EthernetInterface mbed-rtos
Diff: Timer1ExecutionContext.cpp
- Revision:
- 0:5f7bc45bc2e8
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Timer1ExecutionContext.cpp Mon Jun 24 06:42:11 2013 +0000 @@ -0,0 +1,50 @@ +#define RTNO_SUBMODULE_DEFINE + +#include <stdint.h> +#include "RTno.h" +#include "Packet.h" +#include "Timer1ExecutionContext.h" +//#include <avr/io.h> +//#include <avr/interrupt.h> + +static float m_Period; +//static uint8_t m_ClockSetting; + +Ticker *m_pTimer; + +void Timer1EC_start(); +void Timer1EC_suspend(); +void Timer1EC_resume(); + +void tick () { + EC_execute(); +} + + +void Timer1EC_init(double rate) +{ + EC_init(0x22); + m_pTimer = new Ticker(); + // Initialize Period + m_Period = (1.0 / rate); + EC_start = Timer1EC_start; + EC_suspend = Timer1EC_suspend; + EC_resume = Timer1EC_resume; +} + +void Timer1EC_start() +{ + m_pTimer->attach(tick, m_Period); +} + +void Timer1EC_suspend() +{ + m_pTimer->detach(); +} + +void Timer1EC_resume() +{ + Timer1EC_start(); +} + +