diff options
author | Uros Majstorovic <majstor@majstor.org> | 2021-11-25 01:59:07 +0100 |
---|---|---|
committer | Uros Majstorovic <majstor@majstor.org> | 2021-11-25 01:59:07 +0100 |
commit | 6a31936e80ae2743376dcbf9d39cd92461c4deca (patch) | |
tree | f6dedd2cbf3aee9bb8135c7a4ff874c066a6d072 /fw/fe310/test/test.c | |
parent | c44897fda572cf8837b4535a6d1aaad4605c14af (diff) |
i2s init/start/running fixed; i2c start returns error if i2s is running
Diffstat (limited to 'fw/fe310/test/test.c')
-rw-r--r-- | fw/fe310/test/test.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/fw/fe310/test/test.c b/fw/fe310/test/test.c index 9e5c790..cda0255 100644 --- a/fw/fe310/test/test.c +++ b/fw/fe310/test/test.c @@ -26,16 +26,20 @@ int app_test_uievt(EVEForm *form, uint16_t evt, void *param) { uint8_t data = 0; - int ret = 0, i; + int rv, ret = 0, i; switch (evt) { case EVE_UIEVT_PAGE_TOUCH: printf("PAGE TOUCH\n"); printf("BQ25895:\n"); - eos_i2c_start(400000); + rv = eos_i2c_start(400000); + if (rv) { + printf("I2C BUSY\n"); + return 0; + } for (i=0; i<0x15; i++) { - ret = eos_i2c_read8(BQ25895_ADDR, i, &data); - if (!ret) printf("REG%02x: %02x\n", i, data); + rv = eos_i2c_read8(BQ25895_ADDR, i, &data); + if (!rv) printf("REG%02x: %02x\n", i, data); } eos_i2c_stop(); break; |