Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
telemetry-mbed-hal.cpp
00001 /* 00002 * telemetry-mbedo-hal.cpp 00003 * 00004 * Created on: Mar 4, 2015 00005 * Author: Ducky 00006 * 00007 * Telemetry HAL for Serial on mBed. 00008 */ 00009 00010 #ifdef __ARMCC_VERSION 00011 00012 #include "telemetry-mbed.h" 00013 00014 namespace telemetry { 00015 00016 void MbedHal::transmit_byte(uint8_t data) { 00017 // TODO: optimize with DMA 00018 serial.putc(data); 00019 } 00020 00021 size_t MbedHal::rx_available() { 00022 return serial.rxBufferGetCount(); 00023 } 00024 00025 uint8_t MbedHal::receive_byte() { 00026 return serial.getc(); 00027 } 00028 00029 void MbedHal::do_error(const char* msg) { 00030 serial.printf("%s\r\n", msg); 00031 } 00032 00033 uint32_t MbedHal::get_time_ms() { 00034 return timer.read_ms(); 00035 } 00036 00037 } 00038 00039 #endif // ifdef MBED
Generated on Tue Jul 12 2022 22:03:01 by
