mirror of https://github.com/rusefi/rusefi-1.git
options
This commit is contained in:
parent
c392ba8844
commit
2c7b7934ed
|
@ -14,11 +14,6 @@
|
||||||
#include "string.h"
|
#include "string.h"
|
||||||
#include "obd2.h"
|
#include "obd2.h"
|
||||||
|
|
||||||
#if EFI_PROD_CODE || defined(__DOXYGEN__)
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* EFI_PROD_CODE */
|
|
||||||
|
|
||||||
#if EFI_CAN_SUPPORT || defined(__DOXYGEN__)
|
#if EFI_CAN_SUPPORT || defined(__DOXYGEN__)
|
||||||
|
|
||||||
#include "pin_repository.h"
|
#include "pin_repository.h"
|
||||||
|
@ -49,10 +44,19 @@ static THD_WORKING_AREA(canTreadStack, UTILITY_THREAD_STACK_SIZE);
|
||||||
* 29 bit would be CAN_TI0R_EXID (?) but we do not mention it here
|
* 29 bit would be CAN_TI0R_EXID (?) but we do not mention it here
|
||||||
* CAN_TI0R_STID "Standard Identifier or Extended Identifier"? not mentioned as well
|
* CAN_TI0R_STID "Standard Identifier or Extended Identifier"? not mentioned as well
|
||||||
*/
|
*/
|
||||||
static const CANConfig canConfig = {
|
static const CANConfig canConfig500 = {
|
||||||
CAN_MCR_ABOM | CAN_MCR_AWUM | CAN_MCR_TXFP,
|
CAN_MCR_ABOM | CAN_MCR_AWUM | CAN_MCR_TXFP,
|
||||||
CAN_BTR_SJW(0) | CAN_BTR_TS2(1) | CAN_BTR_TS1(8) | CAN_BTR_BRP(6) };
|
CAN_BTR_SJW(0) | CAN_BTR_TS2(1) | CAN_BTR_TS1(8) | CAN_BTR_BRP(6) };
|
||||||
|
|
||||||
|
/*
|
||||||
|
* speed = 42000000 / (BRP + 1) / (1 + TS1 + 1 + TS2 + 1)
|
||||||
|
* 42000000 / 7 / 6 = 1000000
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
static const CANConfig canConfig1000 = {
|
||||||
|
CAN_MCR_ABOM | CAN_MCR_AWUM | CAN_MCR_TXFP,
|
||||||
|
CAN_BTR_SJW(0) | CAN_BTR_TS2(1) | CAN_BTR_TS1(2) | CAN_BTR_BRP(6) };
|
||||||
|
|
||||||
static CANRxFrame rxBuffer;
|
static CANRxFrame rxBuffer;
|
||||||
CANTxFrame txmsg;
|
CANTxFrame txmsg;
|
||||||
|
|
||||||
|
@ -315,10 +319,10 @@ void initCan(void) {
|
||||||
|
|
||||||
#if STM32_CAN_USE_CAN2 || defined(__DOXYGEN__)
|
#if STM32_CAN_USE_CAN2 || defined(__DOXYGEN__)
|
||||||
// CAN1 is required for CAN2
|
// CAN1 is required for CAN2
|
||||||
canStart(&CAND1, &canConfig);
|
canStart(&CAND1, &canConfig500);
|
||||||
canStart(&CAND2, &canConfig);
|
canStart(&CAND2, &canConfig500);
|
||||||
#else
|
#else
|
||||||
canStart(&CAND1, &canConfig);
|
canStart(&CAND1, &canConfig500);
|
||||||
#endif /* STM32_CAN_USE_CAN2 */
|
#endif /* STM32_CAN_USE_CAN2 */
|
||||||
|
|
||||||
chThdCreateStatic(canTreadStack, sizeof(canTreadStack), NORMALPRIO, (tfunc_t) canThread, NULL);
|
chThdCreateStatic(canTreadStack, sizeof(canTreadStack), NORMALPRIO, (tfunc_t) canThread, NULL);
|
||||||
|
|
Loading…
Reference in New Issue