Refs #316. Increased XCPLOADER_CONNECT_TIMEOUT_MS from 20 to 50ms, due to SocketCAN's slower responsiveness. Shortened the wait loop in SocketCAN's interface module from 1ms to 10us to improve throughput.

git-svn-id: https://svn.code.sf.net/p/openblt/code/trunk@326 5dc33758-31d5-4daf-9ae8-b24bf3d40d73
This commit is contained in:
Frank Voorburg 2017-08-02 16:54:29 +00:00
parent 7343e2a9a6
commit 4e11b1401f
2 changed files with 6 additions and 3 deletions

View File

@ -38,6 +38,7 @@
#include <pthread.h> /* for posix threads */
#include <unistd.h> /* UNIX standard functions */
#include <fcntl.h> /* file control operations */
#include <sys/time.h> /* time definitions */
#include <sys/ioctl.h> /* I/O control operations */
#include <net/if.h> /* network interfaces */
#include <linux/can.h> /* CAN kernel definitions */
@ -567,8 +568,10 @@ static void *SocketCanEventThread(void *param)
}
}
}
/* wait a little to not starve the CPU */
UtilTimeDelayMs(1);
/* Wait a little to not starve the CPU, but not too long to prevent interference with
* data throughput.
*/
(void)usleep(10u);
}
/* handshake */

View File

@ -54,7 +54,7 @@
#define XCPLOADER_CMD_PID_RES (0xFFu) /**< positive response */
/** \brief Maximum timeout for the XCP connect command. */
#define XCPLOADER_CONNECT_TIMEOUT_MS (20u)
#define XCPLOADER_CONNECT_TIMEOUT_MS (50u)
/** \brief Number of retries to connect to the XCP slave. */
#define XCPLOADER_CONNECT_RETRIES (5u)