mirror of https://github.com/FOME-Tech/openblt.git
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:
parent
7343e2a9a6
commit
4e11b1401f
|
@ -38,6 +38,7 @@
|
||||||
#include <pthread.h> /* for posix threads */
|
#include <pthread.h> /* for posix threads */
|
||||||
#include <unistd.h> /* UNIX standard functions */
|
#include <unistd.h> /* UNIX standard functions */
|
||||||
#include <fcntl.h> /* file control operations */
|
#include <fcntl.h> /* file control operations */
|
||||||
|
#include <sys/time.h> /* time definitions */
|
||||||
#include <sys/ioctl.h> /* I/O control operations */
|
#include <sys/ioctl.h> /* I/O control operations */
|
||||||
#include <net/if.h> /* network interfaces */
|
#include <net/if.h> /* network interfaces */
|
||||||
#include <linux/can.h> /* CAN kernel definitions */
|
#include <linux/can.h> /* CAN kernel definitions */
|
||||||
|
@ -567,8 +568,10 @@ static void *SocketCanEventThread(void *param)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* wait a little to not starve the CPU */
|
/* Wait a little to not starve the CPU, but not too long to prevent interference with
|
||||||
UtilTimeDelayMs(1);
|
* data throughput.
|
||||||
|
*/
|
||||||
|
(void)usleep(10u);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* handshake */
|
/* handshake */
|
||||||
|
|
|
@ -54,7 +54,7 @@
|
||||||
#define XCPLOADER_CMD_PID_RES (0xFFu) /**< positive response */
|
#define XCPLOADER_CMD_PID_RES (0xFFu) /**< positive response */
|
||||||
|
|
||||||
/** \brief Maximum timeout for the XCP connect command. */
|
/** \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. */
|
/** \brief Number of retries to connect to the XCP slave. */
|
||||||
#define XCPLOADER_CONNECT_RETRIES (5u)
|
#define XCPLOADER_CONNECT_RETRIES (5u)
|
||||||
|
|
Loading…
Reference in New Issue