diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2018-06-30 18:14:01 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-08-11 11:14:22 -0700 |
commit | 7cc9da63474f341ad990da3ecb9c36edcef5a71c (patch) | |
tree | b54f91a36c635d750778cba2205a3bebead7b49c /core/serial_ftdi.c | |
parent | 8b37e3f10e072fc92814a65ccd2c6c5c653a7557 (diff) | |
download | subsurface-7cc9da63474f341ad990da3ecb9c36edcef5a71c.tar.gz |
Android: more FTDI debugging
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core/serial_ftdi.c')
-rw-r--r-- | core/serial_ftdi.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/core/serial_ftdi.c b/core/serial_ftdi.c index 9bcf7aba0..9c410d834 100644 --- a/core/serial_ftdi.c +++ b/core/serial_ftdi.c @@ -155,12 +155,14 @@ static dc_status_t serial_ftdi_open (void **io, dc_context_t *context) // Allocate memory. ftdi_serial_t *device = (ftdi_serial_t *) malloc (sizeof (ftdi_serial_t)); if (device == NULL) { + INFO(0, "couldn't allocate memory"); SYSERROR (context, errno); return DC_STATUS_NOMEMORY; } INFO(0, "setting up ftdi_ctx"); struct ftdi_context *ftdi_ctx = ftdi_new(); if (ftdi_ctx == NULL) { + INFO(0, "failed ftdi_new()"); free(device); SYSERROR (context, errno); return DC_STATUS_NOMEMORY; @@ -189,6 +191,7 @@ static dc_status_t serial_ftdi_open (void **io, dc_context_t *context) return DC_STATUS_IO; } + INFO(0, "call serial_ftdi_open_device"); if (serial_ftdi_open_device(ftdi_ctx) < 0) { free(device); ERROR (context, "%s", ftdi_get_error_string(ftdi_ctx)); @@ -547,9 +550,12 @@ dc_status_t ftdi_open(dc_iostream_t **iostream, dc_context_t *context) serial_ftdi_close, /* close */ }; + INFO(device->contxt, "%s", "in ftdi_open"); rc = serial_ftdi_open(&io, context); - if (rc != DC_STATUS_SUCCESS) + if (rc != DC_STATUS_SUCCESS) { + INFO(device->contxt, "%s", "serial_ftdi_open() failed"); return rc; - + } + INFO(device->contxt, "%s", "calling dc_custom_open())"); return dc_custom_open(iostream, context, DC_TRANSPORT_SERIAL, &callbacks, io); } |