E=MC / telemetry-master
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers telemetry-mbed.h Source File

telemetry-mbed.h

00001 // Make this less hacky and detect properly
00002 #ifdef __ARMCC_VERSION
00003 
00004 #include "telemetry.h"
00005 #include "mbed.h"
00006 #include "MODSERIAL.h"
00007 
00008 namespace telemetry {
00009 
00010 class MbedHal : public HalInterface {
00011 public:
00012   MbedHal(MODSERIAL& serial) :
00013     serial(serial) {
00014       timer.start();
00015   }
00016 
00017   virtual void transmit_byte(uint8_t data);
00018   virtual size_t rx_available();
00019   virtual uint8_t receive_byte();
00020 
00021   virtual void do_error(const char* message);
00022 
00023   virtual uint32_t get_time_ms();
00024 
00025 protected:
00026   MODSERIAL& serial;
00027   Timer timer;
00028 };
00029 
00030 }
00031 
00032 #endif // ifdef MBED