Stefan Kiegerl
/
FuncGen17
Func-Gen - basic setup
FuncGenMain_21.cpp@2:3abf5ddd9fc0, 2021-03-23 (annotated)
- Committer:
- hollegha3
- Date:
- Tue Mar 23 17:06:24 2021 +0000
- Revision:
- 2:3abf5ddd9fc0
- Child:
- 3:9fd12684fa88
xxxx
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
hollegha3 | 2:3abf5ddd9fc0 | 1 | #include "mbed.h" |
hollegha3 | 2:3abf5ddd9fc0 | 2 | #include "Serial_HL.h" |
hollegha3 | 2:3abf5ddd9fc0 | 3 | #include "FuncGenFSST.h" |
hollegha3 | 2:3abf5ddd9fc0 | 4 | |
hollegha3 | 2:3abf5ddd9fc0 | 5 | SerialBLK pc(USBTX, USBRX); |
hollegha3 | 2:3abf5ddd9fc0 | 6 | SvProtocol ua0(&pc); |
hollegha3 | 2:3abf5ddd9fc0 | 7 | |
hollegha3 | 2:3abf5ddd9fc0 | 8 | void CommandHandler(); |
hollegha3 | 2:3abf5ddd9fc0 | 9 | |
hollegha3 | 2:3abf5ddd9fc0 | 10 | int main(void) |
hollegha3 | 2:3abf5ddd9fc0 | 11 | { |
hollegha3 | 2:3abf5ddd9fc0 | 12 | pc.format(8,SerialBLK::None,1); |
hollegha3 | 2:3abf5ddd9fc0 | 13 | pc.baud(500000); // 115200 |
hollegha3 | 2:3abf5ddd9fc0 | 14 | ua0.SvMessage("FuncGen"); // Meldung zum PC senden |
hollegha3 | 2:3abf5ddd9fc0 | 15 | |
hollegha3 | 2:3abf5ddd9fc0 | 16 | Timer stw; stw.start(); |
hollegha3 | 2:3abf5ddd9fc0 | 17 | while(1) { |
hollegha3 | 2:3abf5ddd9fc0 | 18 | CommandHandler(); |
hollegha3 | 2:3abf5ddd9fc0 | 19 | if( stw.read_ms()>10 ) { // 100Hz |
hollegha3 | 2:3abf5ddd9fc0 | 20 | stw.reset(); |
hollegha3 | 2:3abf5ddd9fc0 | 21 | if( ua0.acqON ) { |
hollegha3 | 2:3abf5ddd9fc0 | 22 | } |
hollegha3 | 2:3abf5ddd9fc0 | 23 | } |
hollegha3 | 2:3abf5ddd9fc0 | 24 | } |
hollegha3 | 2:3abf5ddd9fc0 | 25 | return 1; |
hollegha3 | 2:3abf5ddd9fc0 | 26 | } |
hollegha3 | 2:3abf5ddd9fc0 | 27 | |
hollegha3 | 2:3abf5ddd9fc0 | 28 | void CommandHandler() |
hollegha3 | 2:3abf5ddd9fc0 | 29 | { |
hollegha3 | 2:3abf5ddd9fc0 | 30 | uint8_t cmd; |
hollegha3 | 2:3abf5ddd9fc0 | 31 | if( !pc.IsDataAvail() ) |
hollegha3 | 2:3abf5ddd9fc0 | 32 | return; |
hollegha3 | 2:3abf5ddd9fc0 | 33 | } |
hollegha3 | 2:3abf5ddd9fc0 | 34 | |
hollegha3 | 2:3abf5ddd9fc0 | 35 | |
hollegha3 | 2:3abf5ddd9fc0 | 36 | |
hollegha3 | 2:3abf5ddd9fc0 | 37 | |
hollegha3 | 2:3abf5ddd9fc0 | 38 | |
hollegha3 | 2:3abf5ddd9fc0 | 39 | |
hollegha3 | 2:3abf5ddd9fc0 | 40 | |
hollegha3 | 2:3abf5ddd9fc0 | 41 | |
hollegha3 | 2:3abf5ddd9fc0 | 42 | |
hollegha3 | 2:3abf5ddd9fc0 | 43 | |
hollegha3 | 2:3abf5ddd9fc0 | 44 | |
hollegha3 | 2:3abf5ddd9fc0 | 45 | |
hollegha3 | 2:3abf5ddd9fc0 | 46 | |
hollegha3 | 2:3abf5ddd9fc0 | 47 | |
hollegha3 | 2:3abf5ddd9fc0 | 48 | |
hollegha3 | 2:3abf5ddd9fc0 | 49 |