From 331fcf483d9eac2e65e40ec35cf7558132c7c86f Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Fri, 27 Aug 2021 02:27:38 +0200 Subject: test app prints bq25895 regs --- fw/fe310/test/modem.c | 2 +- fw/fe310/test/phone.c | 2 +- fw/fe310/test/test.c | 12 +++++++++++- 3 files changed, 13 insertions(+), 3 deletions(-) (limited to 'fw') diff --git a/fw/fe310/test/modem.c b/fw/fe310/test/modem.c index a2bb0c6..b9fd1b1 100644 --- a/fw/fe310/test/modem.c +++ b/fw/fe310/test/modem.c @@ -69,7 +69,7 @@ static void handle_uart(unsigned char type) { while ((c = eos_uart_getc(0)) != EOS_ERR_EMPTY) { buf[i] = c; i++; - if (i == EOS_NET_SIZE_BUF) break; + if (i == EOS_NET_MTU) break; } eos_net_send(EOS_NET_MTYPE_CELL, buf, i, 0); eos_uart_rxwm_set(0); diff --git a/fw/fe310/test/phone.c b/fw/fe310/test/phone.c index 74936a1..78531b5 100644 --- a/fw/fe310/test/phone.c +++ b/fw/fe310/test/phone.c @@ -48,7 +48,6 @@ static void handle_mic(unsigned char type) { static void cell_voice_handler(unsigned char type, unsigned char *buffer, uint16_t len) { char msg[128]; - printf("VOICE: %d\n", type); msg[0] = 0; switch (type) { case EOS_CELL_MTYPE_VOICE_RING: @@ -61,6 +60,7 @@ static void cell_voice_handler(unsigned char type, unsigned char *buffer, uint16 break; case EOS_CELL_MTYPE_VOICE_BEGIN: + printf("VOICE BEGIN\n"); voice_state = VOICE_STATE_CIP; eos_i2s_start(8000, EOS_I2S_FMT_PCM16); break; diff --git a/fw/fe310/test/test.c b/fw/fe310/test/test.c index bc774d9..9e5c790 100644 --- a/fw/fe310/test/test.c +++ b/fw/fe310/test/test.c @@ -4,6 +4,8 @@ #include #include +#include +#include #include #include #include @@ -23,11 +25,19 @@ #include int app_test_uievt(EVEForm *form, uint16_t evt, void *param) { - int ret = 0; + uint8_t data = 0; + int ret = 0, i; switch (evt) { case EVE_UIEVT_PAGE_TOUCH: printf("PAGE TOUCH\n"); + printf("BQ25895:\n"); + eos_i2c_start(400000); + for (i=0; i<0x15; i++) { + ret = eos_i2c_read8(BQ25895_ADDR, i, &data); + if (!ret) printf("REG%02x: %02x\n", i, data); + } + eos_i2c_stop(); break; default: -- cgit v1.2.3