Skip to content

Commit

Permalink
Periph WORKS - params need to go into a subgroup
Browse files Browse the repository at this point in the history
  • Loading branch information
magicrub committed Nov 22, 2023
1 parent 5da0b50 commit 728eb83
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions Tools/AP_Periph/networking.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,24 @@ const AP_Param::GroupInfo Networking_Periph::var_info[] {
#endif

#if HAL_PERIPH_NETWORK_NUM_PASSTHRU > 0
AP_GROUPINFO("PASS1_EP1", 6, Networking_Periph, passthru[0].ep1, -1),
AP_GROUPINFO("PASS1_EP2", 7, Networking_Periph, passthru[0].ep2, -1),
AP_GROUPINFO("PASS1_EP1", 6, Networking_Periph, passthru[0].ep1, -1),
AP_GROUPINFO("PASS1_EP2", 7, Networking_Periph, passthru[0].ep2, -1),
AP_GROUPINFO("PASS1_BAUD1", 8, Networking_Periph, passthru[0].baud1, 115200),
AP_GROUPINFO("PASS1_BAUD2", 9, Networking_Periph, passthru[0].baud2, 115200),
AP_GROUPINFO("PASS1_OPT1", 10, Networking_Periph, passthru[0].options1, 0),
AP_GROUPINFO("PASS1_OPT2", 11, Networking_Periph, passthru[0].options2, 0),
#endif

#if HAL_PERIPH_NETWORK_NUM_PASSTHRU > 1
AP_GROUPINFO("PASS2_EP1", 8, Networking_Periph, passthru[1].ep1, -1),
AP_GROUPINFO("PASS2_EP2", 9, Networking_Periph, passthru[1].ep2, -1),
AP_GROUPINFO("PASS2_EP1", 15, Networking_Periph, passthru[1].ep1, -1),
AP_GROUPINFO("PASS2_EP2", 16, Networking_Periph, passthru[1].ep2, -1),
AP_GROUPINFO("PASS2_BAUD1", 17, Networking_Periph, passthru[1].baud1, 115200),
AP_GROUPINFO("PASS2_BAUD2", 18, Networking_Periph, passthru[1].baud2, 115200),
AP_GROUPINFO("PASS2_OPT1", 19, Networking_Periph, passthru[1].options1, 0),
AP_GROUPINFO("PASS2_OPT2", 20, Networking_Periph, passthru[1].options2, 0),
#endif


// #if HAL_PERIPH_NETWORK_NUM_PASSTHRU > 0
// // @Group: PASS1_
// // @Path: networking_port.cpp
Expand Down Expand Up @@ -111,7 +120,7 @@ void Networking_Periph::init(void)

p.port1 = serial_manager.get_serial_by_id(p.ep1);
p.port2 = serial_manager.get_serial_by_id(p.ep2);

if (p.port1 != nullptr && p.port2 != nullptr) {
p.port1->set_options(p.options1);
p.port1->begin(p.baud1);
Expand All @@ -133,7 +142,7 @@ void Networking_Periph::update(void)
if (p.port1 == nullptr || p.port2 == nullptr) {
continue;
}
uint8_t buf[64];
uint8_t buf[1024];

// read from port1, and write to port2
auto avail = p.port1->available();
Expand Down

0 comments on commit 728eb83

Please sign in to comment.