aboutsummaryrefslogtreecommitdiff
path: root/cc3200/mods
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2016-05-02 11:15:36 +0100
committerDamien George <damien.p.george@gmail.com>2016-05-02 11:15:36 +0100
commit70ff7350e7ff369ab81d1f55e6645a5828928385 (patch)
tree68da580aaeddc1f6e83cba7f4d50be646d909572 /cc3200/mods
parent26fd0ac5712677ddf2b02f07f4b289b0baf39bce (diff)
stmhal, cc3200: Change i2c.scan() method to scan addresses 0x08-0x77.
A standard I2C address is 7 bits but addresses 0b0000xxx and 0b1111xxx are reserved. The scan() method is changed to reflect this, along with the docs.
Diffstat (limited to 'cc3200/mods')
-rw-r--r--cc3200/mods/pybi2c.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cc3200/mods/pybi2c.c b/cc3200/mods/pybi2c.c
index 70153801e..5022e614f 100644
--- a/cc3200/mods/pybi2c.c
+++ b/cc3200/mods/pybi2c.c
@@ -377,7 +377,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(pyb_i2c_deinit_obj, pyb_i2c_deinit);
STATIC mp_obj_t pyb_i2c_scan(mp_obj_t self_in) {
pyb_i2c_check_init(&pyb_i2c_obj);
mp_obj_t list = mp_obj_new_list(0, NULL);
- for (uint addr = 1; addr <= 127; addr++) {
+ for (uint addr = 0x08; addr <= 0x77; addr++) {
for (int i = 0; i < 3; i++) {
if (pyb_i2c_scan_device(addr)) {
mp_obj_list_append(list, mp_obj_new_int(addr));