Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/lmicdiusb/gdb.c b/lmicdiusb/gdb.c
- index b1220b6..6990149 100644
- --- a/lmicdiusb/gdb.c
- +++ b/lmicdiusb/gdb.c
- @@ -39,6 +39,7 @@
- //*****************************************************************************
- #include "lmicdi.h"
- +#include <ctype.h>
- //****************************************************************************
- //
- @@ -103,16 +104,26 @@ gdb_statemachine(GDBCTX *pGdbCtx, unsigned char *pBuf, unsigned int len,
- if (*pBuf == '+')
- {
- pGdbCtx->iAckCount++;
- - }
- + }
- if (*pBuf == '-')
- {
- pGdbCtx->iNakCount++;
- }
- + if (*pBuf == 0x03) // handle break from arm-none-eabi-gdb user pressing CTRL-C
- + {
- + pGdbCtx->iAckCount++;
- + pGdbCtx->pResp[pGdbCtx->iRd++] = *pBuf;
- + pFn(pGdbCtx, 1);
- + pGdbCtx->iRd = 0;
- + pGdbCtx->gdb_state = GDB_IDLE;
- + pBuf++;
- + break;
- + }
- pGdbCtx->pResp[pGdbCtx->iRd++] = *pBuf;
- pBuf++;
- break;
- case GDB_PAYLOAD:
- - TRACE(0, "GDB_PAYLOAD: '%c'\n", *pBuf);
- + TRACE(0, "GDB_PAYLOAD: '%c' 0x%02x\n", isprint(*pBuf) ? *pBuf : '.', *pBuf);
- pGdbCtx->pResp[pGdbCtx->iRd++] = *pBuf;
- if (*pBuf == '#')
- {
- @@ -200,5 +211,6 @@ usb_callback(struct libusb_transfer *pTrans)
- default:
- TRACE(ALWAYS, "%s: status = 0x%08x\n", __FUNCTION__, pTrans->status);
- + break;
- }
- }
- diff --git a/lmicdiusb/lmicdi.c b/lmicdiusb/lmicdi.c
- index ad22d8d..80b1970 100644
- --- a/lmicdiusb/lmicdi.c
- +++ b/lmicdiusb/lmicdi.c
- @@ -43,7 +43,10 @@
- struct libusb_context *pCtx;
- -unsigned int gTraceLvl = 2;
- +#ifndef TRACE_LEVEL
- +#define TRACE_LEVEL 2
- +#endif
- +unsigned int gTraceLvl = TRACE_LEVEL;
- const struct libusb_endpoint_descriptor *pdEndpIn, *pdEndpOut;
- libusb_device_handle *phDev;
- @@ -159,7 +162,7 @@ main(int argc, char *argv[])
- rc = libusb_init(&pCtx);
- ASSERT(rc == 0);
- - // libusb_set_debug(pCtx, 5);
- + libusb_set_debug(pCtx, 5);
- nDevs = libusb_get_device_list(pCtx, &pDevices);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement