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 RPC_Serial by
main.cpp@0:78952cd3935b, 2010-08-24 (annotated)
- Committer:
- MichaelW
- Date:
- Tue Aug 24 14:25:07 2010 +0000
- Revision:
- 0:78952cd3935b
- Child:
- 1:de34af25056a
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
MichaelW | 0:78952cd3935b | 1 | #include "mbed.h" |
MichaelW | 0:78952cd3935b | 2 | #include "rpc.h" |
MichaelW | 0:78952cd3935b | 3 | |
MichaelW | 0:78952cd3935b | 4 | Serial pc(USBTX, USBRX); |
MichaelW | 0:78952cd3935b | 5 | |
MichaelW | 0:78952cd3935b | 6 | int main() { |
MichaelW | 0:78952cd3935b | 7 | Base::add_rpc_class<AnalogIn>(); |
MichaelW | 0:78952cd3935b | 8 | Base::add_rpc_class<AnalogOut>(); |
MichaelW | 0:78952cd3935b | 9 | Base::add_rpc_class<DigitalIn>(); |
MichaelW | 0:78952cd3935b | 10 | Base::add_rpc_class<DigitalOut>(); |
MichaelW | 0:78952cd3935b | 11 | Base::add_rpc_class<DigitalInOut>(); |
MichaelW | 0:78952cd3935b | 12 | Base::add_rpc_class<PwmOut>(); |
MichaelW | 0:78952cd3935b | 13 | Base::add_rpc_class<Timer>(); |
MichaelW | 0:78952cd3935b | 14 | Base::add_rpc_class<SPI>(); |
MichaelW | 0:78952cd3935b | 15 | Base::add_rpc_class<BusOut>(); |
MichaelW | 0:78952cd3935b | 16 | Base::add_rpc_class<BusIn>(); |
MichaelW | 0:78952cd3935b | 17 | Base::add_rpc_class<BusInOut>(); |
MichaelW | 0:78952cd3935b | 18 | Base::add_rpc_class<Serial>(); |
MichaelW | 0:78952cd3935b | 19 | |
MichaelW | 0:78952cd3935b | 20 | char buf[256], outbuf[256]; |
MichaelW | 0:78952cd3935b | 21 | while(1) { |
MichaelW | 0:78952cd3935b | 22 | pc.gets(buf, 256); |
MichaelW | 0:78952cd3935b | 23 | rpc(buf, outbuf); |
MichaelW | 0:78952cd3935b | 24 | pc.printf("%s\n", outbuf); |
MichaelW | 0:78952cd3935b | 25 | } |
MichaelW | 0:78952cd3935b | 26 | } |