mirror of https://github.com/rusefi/pcan_pro_x.git
Merge branch 'master' into pcan_pro_lin
This commit is contained in:
commit
447350f50f
|
@ -79,6 +79,7 @@ int main(void)
|
|||
pcan_timestamp_init();
|
||||
|
||||
pcan_led_init();
|
||||
pcan_led_set_mode( LED_STAT, LED_MODE_BLINK_FAST, 0xFFFFFFFF );
|
||||
pcan_protocol_init();
|
||||
#if ( INCLUDE_LIN_INTERFACE == 1 )
|
||||
plin_protocol_init();
|
||||
|
|
|
@ -316,7 +316,7 @@ int pcan_can_init_ex( int bus, uint32_t bitrate )
|
|||
p_can->Init.TimeTriggeredMode = DISABLE;
|
||||
p_can->Init.AutoBusOff = ENABLE;
|
||||
p_can->Init.AutoWakeUp = ENABLE;
|
||||
/* do resend packets ! */
|
||||
|
||||
p_can->Init.AutoRetransmission = DISABLE;
|
||||
p_can->Init.ReceiveFifoLocked = DISABLE;
|
||||
p_can->Init.TransmitFifoPriority = ENABLE;
|
||||
|
@ -381,9 +381,11 @@ void pcan_can_set_bus_active( int bus, uint16_t mode )
|
|||
if( mode )
|
||||
{
|
||||
HAL_CAN_Start( p_can );
|
||||
HAL_CAN_AbortTxRequest( p_can, CAN_TX_MAILBOX0 | CAN_TX_MAILBOX1 | CAN_TX_MAILBOX2 );
|
||||
}
|
||||
else
|
||||
{
|
||||
HAL_CAN_AbortTxRequest( p_can, CAN_TX_MAILBOX0 | CAN_TX_MAILBOX1 | CAN_TX_MAILBOX2 );
|
||||
HAL_CAN_Stop( p_can );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -203,7 +203,7 @@ void pcan_ep0_receive( void )
|
|||
pcan_flush_ep( PCAN_USB_EP_MSGIN_CH1 );
|
||||
pcan_flush_ep( PCAN_USB_EP_CMDIN );
|
||||
pcan_device.can_drv_loaded = drv_load_packet[1];
|
||||
pcan_led_set_mode( LED_STAT, LED_MODE_ON, 0 );
|
||||
pcan_led_set_mode( LED_STAT, LED_MODE_BLINK_SLOW, 0xFFFFFFFF );
|
||||
}
|
||||
else
|
||||
pcan_device.lin_drv_loaded = drv_load_packet[1];
|
||||
|
@ -335,7 +335,7 @@ int pcan_protocol_tx_frame( struct ucan_tx_msg *pmsg )
|
|||
msg.flags |= MSG_FLAG_RTR;
|
||||
if( pmsg->flags & UCAN_MSG_EXT_ID )
|
||||
msg.flags |= MSG_FLAG_EXT;
|
||||
if( pmsg->flags & (UCAN_MSG_API_SRR|UCAN_MSG_HW_SRR) )
|
||||
if( pmsg->flags & (/*UCAN_MSG_API_SRR|*/UCAN_MSG_HW_SRR) )
|
||||
{
|
||||
msg.flags |= MSG_FLAG_ECHO;
|
||||
msg.dummy = pmsg->client;
|
||||
|
|
|
@ -243,6 +243,7 @@ void pcan_ep0_receive( void )
|
|||
{
|
||||
pcan_flush_ep( PCAN_USB_EP_MSGIN_CH1 );
|
||||
pcan_flush_ep( PCAN_USB_EP_CMDIN );
|
||||
pcan_led_set_mode( LED_STAT, LED_MODE_BLINK_SLOW, 0xFFFFFFFF );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -33,6 +33,10 @@ void pcan_timestamp_init( void )
|
|||
assert( 0 );
|
||||
break;
|
||||
}
|
||||
|
||||
//HAL_GetTick must not return 0 to use LED events in early stage.
|
||||
//Let's increment the value here by one.
|
||||
HAL_IncTick();
|
||||
}
|
||||
|
||||
uint32_t pcan_timestamp_millis( void )
|
||||
|
|
Loading…
Reference in New Issue