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 _8_CONV_1_SLAVE by
Diff: main.cpp
- Revision:
- 1:455088a984b0
- Parent:
- 0:ab0f6f4ef7ac
- Child:
- 2:42a084b14fb2
--- a/main.cpp Tue Dec 01 22:15:52 2015 +0000
+++ b/main.cpp Sun Dec 06 21:24:27 2015 +0000
@@ -31,7 +31,7 @@
if (uart_rec == UART_NON_CONFIRMATION_CHAR)
break;
}
- slave.stop();
+ //slave.stop();
device.putc(END_OF_TRANSMISSION);
}
else if (addr == (char)(SLAVE_ADDR | 0x01)){
@@ -40,18 +40,23 @@
device.putc(addr);
while(1){
device.putc(DATA_TO_READ_CHAR);
- while(1) { // waiting for data byte from conv2
+ while(1) { // waiting for data byte from conv2 //seems to w8 4ever...
if(device.readable()) {
if (device.getc() == UART_CHAR_INCOMING){
uart_rec2 = device.getc();
break;
}
+
}
}
- if(!slave.write(uart_rec2))
- break;
+ if(!slave.write(uart_rec2)) {
+ device.putc(END_OF_TRANSMISSION);
+ break;
+ }
+
+
}
- slave.stop();
+ slave.read();
}
else {
