Skip to content

Commit

Permalink
switching ethernet driver
Browse files Browse the repository at this point in the history
  • Loading branch information
RCMast3r committed Sep 18, 2024
1 parent 200da81 commit 550754c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
5 changes: 4 additions & 1 deletion include/InterfaceParams.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#ifndef INTERFACEPARAMS
#define INTERFACEPARAMS
#include "NativeEthernet.h"

#include <QNEthernet.h>

using namespace qindesign::network;

namespace EthParams
{
Expand Down
7 changes: 4 additions & 3 deletions lib/interfaces/include/ProtobufMsgInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
#include "pb_decode.h"
#include "pb_common.h"
#include "circular_buffer.h"
#include "NativeEthernet.h"
#include <QNEthernet.h>

#include <functional>
// #include "InterfaceParams.h"

struct ETHInterfaces
{
};

using namespace qindesign::network;

// this should be usable with arbitrary functions idk something
template <size_t buffer_size, typename pb_msg_type, class eth_interface>
Expand All @@ -23,7 +24,7 @@ void handle_ethernet_socket_receive(const SysTick_s& tick, EthernetUDP *socket,
{
uint8_t buffer[buffer_size];
size_t read_bytes = socket->read(buffer, sizeof(buffer));
socket->read(buffer, UDP_TX_PACKET_MAX_SIZE);
socket->read(buffer, 1024);
recv_function(tick.millis, buffer, read_bytes, interface, desc_pointer);
}
}
Expand Down
1 change: 0 additions & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ lib_ldf_mode = deep+
lib_deps =
SPI
Nanopb
https://github.com/vjmuzik/NativeEthernet.git
https://github.com/tonton81/FlexCAN_T4#b928bcb
https://github.com/RCMast3r/hytech_can#4ffbba4
https://github.com/hytech-racing/HT_params/releases/download/2024-05-07T06_59_33/ht_eth_pb_lib.tar.gz
Expand Down
3 changes: 2 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include "FlexCAN_T4.h"
#include "HyTech_CAN.h"
#include "MCU_rev15_defs.h"
// #include "NativeEthernet.h"
#include "pb.h"
// /* Interfaces */
#include "DrivebrainETHInterface.h"
Expand Down Expand Up @@ -49,6 +48,8 @@
/*
PARAMETER STRUCTS
*/
using namespace qindesign::network;


const TelemetryInterfaceReadChannels telem_read_channels = {
.accel1_channel = MCU15_ACCEL1_CHANNEL,
Expand Down

0 comments on commit 550754c

Please sign in to comment.