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.
Diff: main.cpp
- Revision:
- 6:ec3b01ce9687
- Parent:
- 5:b73ea174e997
--- a/main.cpp Tue Oct 14 14:54:32 2014 +0000
+++ b/main.cpp Tue Oct 21 09:45:38 2014 +0000
@@ -41,9 +41,10 @@
while (1) {
int rec = slave.receive();
- switch (rec) {
+ switch (rec) {
case I2CSlave::ReadAddressed:
{
+ pc.printf("ReadAddressed:\r\n");
int value = memory.get(pointer);
buffer[0] = pointer;
intToByte(buffer+1, value);
@@ -56,9 +57,10 @@
}
case I2CSlave::WriteAddressed:
{
+ pc.printf("WriteAddressed:\r\n");
// First we read the command byte
int command = slave.read();
-
+ pc.printf("Command: %d \r\n", command);
// Check the command
switch (command)
{
@@ -93,10 +95,12 @@
case CLEAR:
pc.printf("Clearing the memory\r\n");
memory.reset();
+ slave.stop();
break;
case PRINT:
memory.print();
+ slave.stop();
break;
default: