Optimaze with new mbed os for study
Dependencies: TS_DISCO_F746NG BSP_DISCO_F746NG Graphics
RadarDemo/RadarTimer.h@3:732f7144ec81, 2016-11-05 (annotated)
- Committer:
- karpent
- Date:
- Sat Nov 05 15:36:59 2016 +0000
- Revision:
- 3:732f7144ec81
- Child:
- 4:66f13188c26b
RadarTimer class added
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
karpent | 3:732f7144ec81 | 1 | #include "mbed.h" |
karpent | 3:732f7144ec81 | 2 | |
karpent | 3:732f7144ec81 | 3 | |
karpent | 3:732f7144ec81 | 4 | /** |
karpent | 3:732f7144ec81 | 5 | * @brief Radar time subsystem |
karpent | 3:732f7144ec81 | 6 | */ |
karpent | 3:732f7144ec81 | 7 | class RadarTimer : public Timer |
karpent | 3:732f7144ec81 | 8 | { |
karpent | 3:732f7144ec81 | 9 | public: |
karpent | 3:732f7144ec81 | 10 | RadarTimer(); |
karpent | 3:732f7144ec81 | 11 | |
karpent | 3:732f7144ec81 | 12 | /** |
karpent | 3:732f7144ec81 | 13 | * @brief Sets scan period in seconds |
karpent | 3:732f7144ec81 | 14 | */ |
karpent | 3:732f7144ec81 | 15 | RadarTimer(uint32_t scanPeriod); |
karpent | 3:732f7144ec81 | 16 | |
karpent | 3:732f7144ec81 | 17 | /** |
karpent | 3:732f7144ec81 | 18 | * @brief Sets scan period in seconds |
karpent | 3:732f7144ec81 | 19 | */ |
karpent | 3:732f7144ec81 | 20 | void SetScanPeriod(uint32_t scanPeriod); |
karpent | 3:732f7144ec81 | 21 | |
karpent | 3:732f7144ec81 | 22 | /** |
karpent | 3:732f7144ec81 | 23 | * @brief Starts the timer |
karpent | 3:732f7144ec81 | 24 | */ |
karpent | 3:732f7144ec81 | 25 | void Start(); |
karpent | 3:732f7144ec81 | 26 | |
karpent | 3:732f7144ec81 | 27 | void RegisterScan(); |
karpent | 3:732f7144ec81 | 28 | |
karpent | 3:732f7144ec81 | 29 | /** |
karpent | 3:732f7144ec81 | 30 | * @brief Get current time in miliseconds |
karpent | 3:732f7144ec81 | 31 | */ |
karpent | 3:732f7144ec81 | 32 | uint32_t GetRunningTime(); |
karpent | 3:732f7144ec81 | 33 | |
karpent | 3:732f7144ec81 | 34 | /** |
karpent | 3:732f7144ec81 | 35 | * @brief Get current beam angle in radians |
karpent | 3:732f7144ec81 | 36 | */ |
karpent | 3:732f7144ec81 | 37 | float GetBeamAngle(); |
karpent | 3:732f7144ec81 | 38 | |
karpent | 3:732f7144ec81 | 39 | private: |
karpent | 3:732f7144ec81 | 40 | /// <summary> |
karpent | 3:732f7144ec81 | 41 | /// The radar scan period in milisecons. |
karpent | 3:732f7144ec81 | 42 | /// </summary> |
karpent | 3:732f7144ec81 | 43 | uint32_t _scanPeriod; |
karpent | 3:732f7144ec81 | 44 | |
karpent | 3:732f7144ec81 | 45 | uint32_t _lastScanTime; |
karpent | 3:732f7144ec81 | 46 | |
karpent | 3:732f7144ec81 | 47 | uint32_t _runningTime; |
karpent | 3:732f7144ec81 | 48 | }; |