Skip to content
Snippets Groups Projects
Commit 4fe16d5e authored by Micah Elizabeth Scott's avatar Micah Elizabeth Scott
Browse files

Fix memory leak

parent 50a0ed88
No related branches found
No related tags found
No related merge requests found
...@@ -53,12 +53,15 @@ bool ARMDebug::identify() ...@@ -53,12 +53,15 @@ bool ARMDebug::identify()
libswd_ctx_t *libswdctx = (libswd_ctx_t*) this->context; libswd_ctx_t *libswdctx = (libswd_ctx_t*) this->context;
int *idcode; int *idcode;
libswd_cmdq_free_head(libswdctx->cmdq);
if (libswd_dap_detect(libswdctx, LIBSWD_OPERATION_EXECUTE, &idcode) < 0) if (libswd_dap_detect(libswdctx, LIBSWD_OPERATION_EXECUTE, &idcode) < 0)
return false; return false;
libswd_log(libswdctx, LIBSWD_LOGLEVEL_NORMAL, libswd_log(libswdctx, LIBSWD_LOGLEVEL_NORMAL,
"Found ARM processor. IDCODE: 0x%X (%s)\n", "Found ARM processor. IDCODE: 0x%X (%s)\n",
*idcode, libswd_bin32_string(idcode)); *idcode, libswd_bin32_string(idcode));
return true; return true;
} }
......
...@@ -26,6 +26,7 @@ void loop() ...@@ -26,6 +26,7 @@ void loop()
Serial.println("--------------------------------------------"); Serial.println("--------------------------------------------");
Serial.println(" Fadecandy Test Jig : Press button to start"); Serial.println(" Fadecandy Test Jig : Press button to start");
Serial.println("--------------------------------------------"); Serial.println("--------------------------------------------");
Serial.println("");
while (digitalRead(buttonPin) == LOW); while (digitalRead(buttonPin) == LOW);
while (digitalRead(buttonPin) == HIGH) { while (digitalRead(buttonPin) == HIGH) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment