Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: hartmutbehrens/CAN_Ethernet
base: f45a9d5eab
...
head fork: hartmutbehrens/CAN_Ethernet
compare: 3dd4a2923d
  • 2 commits
  • 2 files changed
  • 0 commit comments
  • 1 contributor
Showing with 7 additions and 7 deletions.
  1. +4 −4 c2e_can.c
  2. +3 −3 c2e_udp.c
View
8 c2e_can.c
@@ -126,11 +126,11 @@ int CAN_receive_FIFO(unsigned char *data, uint32_t rx_size)
CAN_data.rx_msg_object.ulFlags = MSG_OBJ_RX_INT_ENABLE | MSG_OBJ_EXTENDED_ID | MSG_OBJ_USE_ID_FILTER | MSG_OBJ_USE_EXT_FILTER;
CAN_data.rx_msg_object.pucMsgData = data; // allocate the memory from the beginning of the FIFO location
- for(idx=0; idx < (CAN_FIFO_SIZE / 8); idx++) // Transfer bytes in multiples of eight bytes.
+ for( idx=0; idx < (CAN_FIFO_SIZE / 8); idx++ ) // Transfer bytes in multiples of eight bytes.
{
// If there are more than eight remaining to be received then just queue up eight bytes and go on to the next message object(s) for the remaining bytes.
- if(rx_size > 8)
+ if( rx_size > 8 )
{
CAN_data.rx_msg_object.ulMsgLen = 8; // The length is always eight as the full buffer is divisible by 8.
rx_size -=8; // There are now eight less bytes to receive.
@@ -152,11 +152,11 @@ void CAN_extract(unsigned char *data)
CAN_data.tx_msg_object.ulMsgID = uchar_to_uint32(&data[CAN_ID_POS]); // set CAN id
CAN_data.tx_msg_object.ulMsgIDMask = 0; // don't mask any messages
CAN_data.tx_msg_object.ulFlags = MSG_OBJ_TX_INT_ENABLE; // enable interrupts for transmitted messages.
- if (data[EXT_FLAG_POS])
+ if ( data[EXT_FLAG_POS] )
{
CAN_data.tx_msg_object.ulFlags |= MSG_OBJ_EXTENDED_ID;
}
- if (data[RTR_FLAG_POS])
+ if ( data[RTR_FLAG_POS] )
{
CAN_data.tx_msg_object.ulFlags |= MSG_OBJ_REMOTE_FRAME;
}
View
6 c2e_udp.c
@@ -110,8 +110,6 @@ void process_CAN_data(unsigned char *data, uint32_t total_size)
CAN_transmit();
position += CAN_FRAME_SIZE;
}
- udp_rx_count += 1;
- update_count += 1;
}
// This function is called by the lwIP TCP/IP stack when it receives a UDP packet from the discovery port.
@@ -123,6 +121,8 @@ void UDP_receive(void *arg, struct udp_pcb *pcb, struct pbuf *p, struct ip_addr
if ( message_starts_with(data, C2E_DATA_ID) ) // received a message with CAN data, so send it out on the CAN i/f
{
process_CAN_data(&data[0], p->len);
+ udp_rx_count += 1;
+ update_count += 1;
}
if ( message_starts_with(data, C2E_BROADCAST_ID) ) // found a gateway, so add the IP address to the list of known gateways
{
@@ -153,7 +153,7 @@ void UDP_broadcast_presence()
void display_UDP_statistics(void)
{
- if (update_count >= UDP_UPDATERATE)
+ if ( update_count >= UDP_UPDATERATE )
{
usprintf(print_buf, "UDP TX %u ", udp_tx_count);
RIT128x96x4StringDraw(print_buf, 5, 50, 15);

No commit comments for this range

Something went wrong with that request. Please try again.