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
Diff: src/boards.cpp
- Revision:
- 51:abe8a392d50b
- Parent:
- 49:65c714a5def2
- Child:
- 52:2b3b194144da
diff -r db7056081354 -r abe8a392d50b src/boards.cpp
--- a/src/boards.cpp Tue Mar 12 22:16:28 2019 +0000
+++ b/src/boards.cpp Wed Mar 13 19:10:40 2019 +0000
@@ -34,11 +34,10 @@
#include "all_io.h"
#include "serial.h"
#include "stdio.h"
+#include "th_rtz.h"
unsigned int boardEnableBits;
-InterruptIn i2c(PB_7);
-
/*******************************************************************************
initI2C
*******************************************************************************/
@@ -71,18 +70,16 @@
*******************************************************************************/
void sendSlaveCommands(unsigned short slave_code){
- char data_write[2];
+ char data_write;
int status;
// Write slave1 code
- data_write[1] = 0;
- data_write[0] = slave_code | 0x00FF;
- //status = i2c.write(i2c_addr_slave1, data_write, 2, 0);
+ data_write = slave_code | 0x00FF;
+ sendByte(1, data_write);
// Write slave2 code
- data_write[1] = 0;
- data_write[0] = slave_code | 0xFF00;
- //status = i2c.write(i2c_addr_slave2, data_write, 2, 0);
+ data_write = (slave_code | 0xFF00) >> 8;
+ sendByte(2, data_write);
}