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.
Fork of priustroller_current by
debug/debug.h@24:f1ff9c7256b5, 2015-03-09 (annotated)
- Committer:
- bwang
- Date:
- Mon Mar 09 11:33:14 2015 +0000
- Revision:
- 24:f1ff9c7256b5
- Child:
- 53:ef62d7a958f2
Added multi-channel debug logger in debug/, set up #channels and depth in main(), write in log() function. motor stops turning after trace is captured, requires reset to restart
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| bwang | 24:f1ff9c7256b5 | 1 | #ifndef __DEBUG_H |
| bwang | 24:f1ff9c7256b5 | 2 | #define __DEBUG_H |
| bwang | 24:f1ff9c7256b5 | 3 | |
| bwang | 24:f1ff9c7256b5 | 4 | #include "includes.h" |
| bwang | 24:f1ff9c7256b5 | 5 | #include "context.h" |
| bwang | 24:f1ff9c7256b5 | 6 | |
| bwang | 24:f1ff9c7256b5 | 7 | class BufferedDebugger { |
| bwang | 24:f1ff9c7256b5 | 8 | public: |
| bwang | 24:f1ff9c7256b5 | 9 | BufferedDebugger(Context *context, int channels, int size); |
| bwang | 24:f1ff9c7256b5 | 10 | void Write(int channel, float f); |
| bwang | 24:f1ff9c7256b5 | 11 | void Flush(); |
| bwang | 24:f1ff9c7256b5 | 12 | void Restart(); |
| bwang | 24:f1ff9c7256b5 | 13 | private: |
| bwang | 24:f1ff9c7256b5 | 14 | Context *_context; |
| bwang | 24:f1ff9c7256b5 | 15 | int _size; |
| bwang | 24:f1ff9c7256b5 | 16 | int _channels; |
| bwang | 24:f1ff9c7256b5 | 17 | int *_index; |
| bwang | 24:f1ff9c7256b5 | 18 | int _done; |
| bwang | 24:f1ff9c7256b5 | 19 | float *_buffer; |
| bwang | 24:f1ff9c7256b5 | 20 | }; |
| bwang | 24:f1ff9c7256b5 | 21 | |
| bwang | 24:f1ff9c7256b5 | 22 | #endif |
