|
From: | Jean-Christophe DUBOIS |
Subject: | Re: [Qemu-devel] [PATCH v13 18/19] i.MX: Add qtest support for I2C device emulator. |
Date: | Mon, 10 Aug 2015 18:19:09 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 |
Le 07/08/2015 15:05, Peter Maydell a écrit :
On 16 July 2015 at 22:21, Jean-Christophe Dubois <address@hidden> wrote:This is using a ds1338 RTC chip on the I2C bus. This RTC chip is not present on the real 3DS PDK board. Signed-off-by: Jean-Christophe Dubois <address@hidden>'make check' doesn't pass with this patch, because it tries to start an "imx25_3ds" machine, which doesn't exist.
Thanks, I will fix it.
+#define bcd2bin(x) (((x) & 0x0f) + ((x) >> 4) * 10)Why not just make this an inline function?+static void send_and_receive(void) +{ + uint8_t cmd[1]; + uint8_t resp[7]; + time_t now = time(NULL); + struct tm *tm_ptr = gmtime(&now); + + /* reset the index in the RTC memory */ + cmd[0] = 0; + i2c_send(i2c, addr, cmd, 1); + + /* retrieve the date */ + i2c_recv(i2c, addr, resp, 7); + + /* check retreived time againt local time */"retrieved" -- PMM
[Prev in Thread] | Current Thread | [Next in Thread] |