mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-18 06:38:29 -04:00
AP_Networking: simplify port registration
This commit is contained in:
parent
65ffe713b4
commit
e06d65bd75
@ -58,9 +58,7 @@ const AP_Param::GroupInfo AP_Networking::Port::var_info[] = {
|
|||||||
*/
|
*/
|
||||||
void AP_Networking::ports_init(void)
|
void AP_Networking::ports_init(void)
|
||||||
{
|
{
|
||||||
// init in reverse order to keep the linked list in
|
for (uint8_t i=0; i<ARRAY_SIZE(ports); i++) {
|
||||||
// AP_SerialManager in the right order
|
|
||||||
for (int8_t i=ARRAY_SIZE(ports)-1; i>= 0; i--) {
|
|
||||||
auto &p = ports[i];
|
auto &p = ports[i];
|
||||||
NetworkPortType ptype = (NetworkPortType)p.type;
|
NetworkPortType ptype = (NetworkPortType)p.type;
|
||||||
p.state.idx = AP_SERIALMANAGER_NET_PORT_1 + i;
|
p.state.idx = AP_SERIALMANAGER_NET_PORT_1 + i;
|
||||||
|
Loading…
Reference in New Issue
Block a user