summaryrefslogtreecommitdiff
path: root/fw/fe310/test
diff options
context:
space:
mode:
Diffstat (limited to 'fw/fe310/test')
-rw-r--r--fw/fe310/test/cam.c4
-rw-r--r--fw/fe310/test/test.c12
2 files changed, 10 insertions, 6 deletions
diff --git a/fw/fe310/test/cam.c b/fw/fe310/test/cam.c
index caab2cc..3162b40 100644
--- a/fw/fe310/test/cam.c
+++ b/fw/fe310/test/cam.c
@@ -139,9 +139,9 @@ void app_cam(EVEWindow *window, EVEViewStack *stack) {
eve_gpio_set(EVE_GPIO_CAM, 1);
eos_time_sleep(100);
- eos_i2c_start(100000);
- rv = eos_ov2640_init();
+ rv = eos_i2c_start(100000);
+ if (!rv) rv = eos_ov2640_init();
if (!rv) rv = eos_ov2640_set_pixfmt(PIXFORMAT_JPEG);
if (!rv) rv = eos_ov2640_set_framesize(FRAMESIZE_VGA);
eos_i2c_stop();
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;