Optimaze with new mbed os for study
Dependencies: TS_DISCO_F746NG BSP_DISCO_F746NG Graphics
Diff: RadarDemo/RadarTimer.h
- Revision:
- 3:732f7144ec81
- Child:
- 4:66f13188c26b
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/RadarDemo/RadarTimer.h Sat Nov 05 15:36:59 2016 +0000 @@ -0,0 +1,48 @@ +#include "mbed.h" + + +/** + * @brief Radar time subsystem + */ +class RadarTimer : public Timer +{ +public: + RadarTimer(); + + /** + * @brief Sets scan period in seconds + */ + RadarTimer(uint32_t scanPeriod); + + /** + * @brief Sets scan period in seconds + */ + void SetScanPeriod(uint32_t scanPeriod); + + /** + * @brief Starts the timer + */ + void Start(); + + void RegisterScan(); + + /** + * @brief Get current time in miliseconds + */ + uint32_t GetRunningTime(); + + /** + * @brief Get current beam angle in radians + */ + float GetBeamAngle(); + +private: + /// <summary> + /// The radar scan period in milisecons. + /// </summary> + uint32_t _scanPeriod; + + uint32_t _lastScanTime; + + uint32_t _runningTime; +}; \ No newline at end of file