![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Hackaday demo: Signal generator
Dependencies: SDFileSystem mbed
main.cpp@0:8baa10bd07de, 2015-09-11 (annotated)
- Committer:
- wd5gnr
- Date:
- Fri Sep 11 02:32:43 2015 +0000
- Revision:
- 0:8baa10bd07de
Initial commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
wd5gnr | 0:8baa10bd07de | 1 | #include "mbed.h" |
wd5gnr | 0:8baa10bd07de | 2 | |
wd5gnr | 0:8baa10bd07de | 3 | #define _EXTERN_ |
wd5gnr | 0:8baa10bd07de | 4 | #include "main.h" |
wd5gnr | 0:8baa10bd07de | 5 | #include "sdcard.h" |
wd5gnr | 0:8baa10bd07de | 6 | #include "cio.h" |
wd5gnr | 0:8baa10bd07de | 7 | #include "output.h" |
wd5gnr | 0:8baa10bd07de | 8 | #include "command.h" |
wd5gnr | 0:8baa10bd07de | 9 | |
wd5gnr | 0:8baa10bd07de | 10 | |
wd5gnr | 0:8baa10bd07de | 11 | #define BAUD 57600 |
wd5gnr | 0:8baa10bd07de | 12 | |
wd5gnr | 0:8baa10bd07de | 13 | // Atbitrary Pattern Generator -- Williams |
wd5gnr | 0:8baa10bd07de | 14 | |
wd5gnr | 0:8baa10bd07de | 15 | // Serial port |
wd5gnr | 0:8baa10bd07de | 16 | Serial pc(USBTX, USBRX); |
wd5gnr | 0:8baa10bd07de | 17 | // Switch to supress auto loading |
wd5gnr | 0:8baa10bd07de | 18 | DigitalIn NoBoot(SW2); // NOTE: If you don't have a switch on PTA4 you may need to comment this out and the auto_open line below |
wd5gnr | 0:8baa10bd07de | 19 | |
wd5gnr | 0:8baa10bd07de | 20 | |
wd5gnr | 0:8baa10bd07de | 21 | |
wd5gnr | 0:8baa10bd07de | 22 | int main() |
wd5gnr | 0:8baa10bd07de | 23 | { |
wd5gnr | 0:8baa10bd07de | 24 | timebaseus=25.0f; // set default |
wd5gnr | 0:8baa10bd07de | 25 | pc.baud(BAUD); // set baudrate |
wd5gnr | 0:8baa10bd07de | 26 | if (NoBoot==1) auto_open(); // see note above |
wd5gnr | 0:8baa10bd07de | 27 | command(); // Do commands, returns on g command |
wd5gnr | 0:8baa10bd07de | 28 | exec(); // never returns |
wd5gnr | 0:8baa10bd07de | 29 | } |