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.
Dependencies: mbed SimpleSerialProtocol MODSERIAL
Diff: TestProtocol.h
- Revision:
- 5:f693f68e9de6
- Parent:
- 4:c0a69c32d054
- Child:
- 6:d33e929ebaa9
--- a/TestProtocol.h Mon Jan 16 22:45:34 2012 +0000
+++ b/TestProtocol.h Sat Mar 17 16:42:31 2012 +0000
@@ -7,12 +7,12 @@
//class will receive a packet and echo it back out
class TestProtocol : public SimpleSerialProtocol::Protocol {
public:
- TestProtocol() : Protocol(p9, p10, NC) { //LED1 to 4 for a status led, NC to disable
- _dma_port = 0; //set the dma port, must be unique per class 0 - 9
- packetCallback(1, this, &TestProtocol::onEchoPacket);
+ TestProtocol() : Protocol(USBTX, USBRX, LED1) { //LED1 to 4 for a status led, NC to disable
+ _dma_port = MODDMA::Channel_7; //set the dma port, must be unique per class 0 - 9
+ receiveCallback(1, this, &TestProtocol::onEchoPacket);
}
virtual ~TestProtocol() {};
- uint32_t onEchoPacket(uint32_t packet_ptr_value);
+ void onEchoPacket(SimpleSerialProtocol::Packet* packet);
void reply();
class EchoPacket : public SimpleSerialProtocol::Packet {