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:
- 4:9e2adff677ac
- Parent:
- 3:45f63cbde7b3
- Child:
- 5:d622f8a4a016
- Child:
- 7:e86480c767ea
--- a/main.cpp Tue Dec 15 22:44:11 2015 +0000
+++ b/main.cpp Wed Dec 16 19:42:44 2015 +0000
@@ -9,12 +9,12 @@
void i2cStart(void){
SDA_interrupt.disable_irq();
char addr = (char)slave.read();
- if (addr == SLAVE_ADDR) {
+ if (addr == RTC_ADDR) {
count = 0;
char uart_rec;
device.putc(DATA_TO_WRITE_CHAR);
device.putc(addr);
- while(!SDA_state) {
+ while(!SDA_state) { //writting to slave
buffer = (char)slave.read();
for(int y = 0; y < 1024; y++){} //some delay required for signal establishment
if(SDA_state) break;
@@ -34,7 +34,7 @@
//slave.stop();
device.putc(END_OF_TRANSMISSION);
}
- else if (addr & 0x01 == 0x01){
+ else if (addr & 0x01 == 0x01){ //reading from slave
char uart_rec2;
device.putc(DATA_TO_WRITE_CHAR);
device.putc(addr);
@@ -66,5 +66,5 @@
SDA_interrupt.fall(&i2cStart);
slave.frequency(100000);
device.baud(921600);
- slave.address(SLAVE_ADDR);
+ slave.address(RTC_ADDR);
}
\ No newline at end of file
