Skip to content
Snippets Groups Projects
Commit af33ebb1 authored by Daniel Campora's avatar Daniel Campora
Browse files

cc3200: Increment telnet Tx retry delay on every try.

parent 9220dc46
No related branches found
No related tags found
No related merge requests found
......@@ -47,7 +47,7 @@
// rxRindex and rxWindex must be uint8_t and TELNET_RX_BUFFER_SIZE == 256
#define TELNET_RX_BUFFER_SIZE 256
#define TELNET_MAX_CLIENTS 1
#define TELNET_TX_RETRIES_MAX 25
#define TELNET_TX_RETRIES_MAX 50
#define TELNET_WAIT_TIME_MS 5
#define TELNET_LOGIN_RETRIES_MAX 3
#define TELNET_CYCLE_TIME_MS (SERVERS_CYCLE_TIME_MS * 2)
......@@ -493,6 +493,7 @@ static void telnet_parse_input (uint8_t *str, int16_t *len) {
static bool telnet_send_with_retries (int16_t sd, const void *pBuf, int16_t len) {
int32_t retries = 0;
uint32_t delay = TELNET_WAIT_TIME_MS;
// only if we are not within interrupt context and interrupts are enabled
if ((HAL_NVIC_INT_CTRL_REG & HAL_VECTACTIVE_MASK) == 0 && query_irq() == IRQ_STATE_ENABLED) {
do {
......@@ -503,7 +504,8 @@ static bool telnet_send_with_retries (int16_t sd, const void *pBuf, int16_t len)
else if (SL_EAGAIN != result) {
return false;
}
HAL_Delay (TELNET_WAIT_TIME_MS);
// start with the default delay and increment it on each retry
HAL_Delay (delay++);
} while (++retries <= TELNET_TX_RETRIES_MAX);
}
return false;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment