From a0b34a4beac24d041a219c8b5c58859984602095 Mon Sep 17 00:00:00 2001 From: David Betz Date: Tue, 10 Feb 2015 16:55:23 -0500 Subject: [PATCH] Remove some debugging output. --- osint_linux.c | 2 +- p1load.c | 6 ++++++ ploader.c | 1 + ploader.h | 1 + 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/osint_linux.c b/osint_linux.c index 222c0e6..220bfa1 100644 --- a/osint_linux.c +++ b/osint_linux.c @@ -89,7 +89,7 @@ int use_reset_method(char* method) } } - printf ("Using GPIO pin %d as Propeller reset ", propellerResetGpioPin); + //printf ("Using GPIO pin %d as Propeller reset ", propellerResetGpioPin); if (propellerResetGpioLevel) { printf ("(HIGH).\n"); diff --git a/p1load.c b/p1load.c index b29586c..c495fd7 100644 --- a/p1load.c +++ b/p1load.c @@ -59,6 +59,11 @@ static int cb_rx_timeout(void *data, uint8_t* buf, int n, int timeout) return rx_timeout(buf, n, timeout); } +static void cb_msleep(void *data, int msecs) +{ + msleep(msecs); +} + static void cb_progress(void *data, int phase) { switch (phase) { @@ -120,6 +125,7 @@ int main(int argc, char *argv[]) state.tx = cb_tx; state.rx_timeout = cb_rx_timeout; state.progress = cb_progress; + state.msleep = cb_msleep; #ifdef RASPBERRY_PI { char cmd[20] = "gpio,17,0"; diff --git a/ploader.c b/ploader.c index bb16be1..212bc52 100644 --- a/ploader.c +++ b/ploader.c @@ -97,6 +97,7 @@ static int WaitForAck(PL_state *state, int retries) { uint8_t buf[1]; while (--retries >= 0) { + (*state->msleep)(state->serialData, 20); TByte(state, 0xf9); TComm(state); if ((*state->rx_timeout)(state->serialData, buf, 1, ACK_TIMEOUT) > 0) diff --git a/ploader.h b/ploader.h index ca105ca..8ef1ff3 100644 --- a/ploader.h +++ b/ploader.h @@ -45,6 +45,7 @@ typedef struct { void (*reset)(void *data); int (*tx)(void *data, uint8_t* buf, int n); int (*rx_timeout)(void *data, uint8_t* buf, int n, int timeout); + void (*msleep)(void *data, int msecs); void *serialData; /* load progress interface */