replace goto statement by a while loop
@@ -214,7 +214,12 @@ error_return_t Robus_SendMsg(ll_container_t *ll_container, msg_t *msg)
uint16_t Robus_TopologyDetection(ll_container_t *ll_container)
{
uint8_t redetect_nb = 0;
-redetect:
+ bool detect_enabled = true;
+
+ while (detect_enabled)
+ {
+ detect_enabled = false;
+
// Reset all detection state of containers on the network
Robus_ResetNetworkDetection(ll_container);
@@ -231,7 +236,8 @@ redetect:
LUOS_ASSERT((redetect_nb <= 4));
// Detection fail, restart it
redetect_nb++;
- goto redetect;
+ detect_enabled = true;
+ }
}
return last_node;
