fixes wrong append pointer assignment in minres ethmac driver
This commit was merged in pull request #3.
This commit is contained in:
@@ -21,6 +21,12 @@ set(NXD_ENABLE_FILE_SERVERS OFF)
|
||||
set(NX_USER_FILE ${CMAKE_CURRENT_LIST_DIR}/port/threadx/inc/nx_user.h)
|
||||
add_subdirectory(third-party/netxduo)
|
||||
target_link_libraries(netxduo PUBLIC c)
|
||||
if(NX_DEBUG)
|
||||
target_compile_definitions(netxduo PRIVATE NX_DEBUG NX_DEBUG_PACKET NX_ENABLE_PACKET_DEBUG_INFO)
|
||||
endif()
|
||||
if(TX_TRACE)
|
||||
target_compile_definitions(netxduo PUBLIC TX_ENABLE_EVENT_TRACE)
|
||||
endif()
|
||||
###############################################################################
|
||||
project(threadx_demo C ASM)
|
||||
option(NX_DEBUG "compile netxduo debug output in" OFF)
|
||||
|
||||
@@ -799,7 +799,7 @@ void _nx_mnrs_network_driver_receive(NX_IP* ip_ptr, NX_PACKET* packet_ptr, UINT
|
||||
/* Adjust the packet length. */
|
||||
packet_ptr->nx_packet_length = packet_ptr->nx_packet_length - NX_ETHERNET_SIZE;
|
||||
/* Route to the ip receive function. */
|
||||
#ifdef NX_DEBUG_PACKET
|
||||
#ifdef NX_DEBUG
|
||||
printf("NetX MNRS ETH Driver IP Packet Receive - %s\n", ip_ptr->nx_ip_name);
|
||||
#endif
|
||||
_nx_ip_packet_deferred_receive(ip_ptr, packet_ptr);
|
||||
@@ -895,8 +895,9 @@ VOID _nx_mnrs_eth_recv_packet(UINT i)
|
||||
UINT packet_type;
|
||||
|
||||
/* read the number of bits in the frame and convert it into number of words to read */
|
||||
bits_received = get_ethmac_mac_rx(nx_mnrs_driver[i].ethmac);
|
||||
words_to_read = (bits_received + 31) / 32;
|
||||
bits_received = get_ethmac_mac_rx(nx_mnrs_driver[i].ethmac);
|
||||
bytes_received = (bits_received + 7) / 8;
|
||||
words_to_read = (bits_received + 31) / 32;
|
||||
if (words_to_read < 4)
|
||||
{
|
||||
for (j = 0; j < words_to_read; j++)
|
||||
@@ -956,8 +957,8 @@ VOID _nx_mnrs_eth_recv_packet(UINT i)
|
||||
}
|
||||
else
|
||||
{
|
||||
packet_ptr->nx_packet_length = (ULONG)bytes_received;
|
||||
packet_ptr->nx_packet_append_ptr += (ULONG)bytes_received;
|
||||
packet_ptr->nx_packet_length = bytes_received;
|
||||
packet_ptr->nx_packet_append_ptr += bytes_received;
|
||||
}
|
||||
|
||||
_nx_mnrs_network_driver_receive(ip_ptr, packet_ptr, i);
|
||||
|
||||
@@ -776,3 +776,7 @@ extern "C"
|
||||
#define NX_RAND rand
|
||||
#define NX_SRAND srand
|
||||
#endif
|
||||
// hacky workaround for missing include in netxduo/common/src/nx_ram_network_driver.c
|
||||
#ifdef NX_DEBUG
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
@@ -103,8 +103,6 @@ typedef unsigned long long ULONG64;
|
||||
typedef short SHORT;
|
||||
typedef unsigned short USHORT;
|
||||
#define ULONG64_DEFINED
|
||||
#define ALIGN_TYPE_DEFINED
|
||||
#define ALIGN_TYPE ULONG64
|
||||
|
||||
/* Define the priority levels for ThreadX. Legal values range
|
||||
from 32 to 1024 and MUST be evenly divisible by 32. */
|
||||
|
||||
Reference in New Issue
Block a user