@@ -34,7 +34,7 @@ static uint16_t const UDP_SERVER_PORT = 8888;
3434 * GLOBAL VARIABLES
3535 **************************************************************************************/
3636
37- auto const tc6_io = new TC6::TC6_Io(
37+ TC6::TC6_Io tc6_io (
3838#if defined(ARDUINO_GIGA) || defined(ARDUINO_PORTENTA_C33)
3939 SPI1
4040#else
@@ -43,7 +43,7 @@ auto const tc6_io = new TC6::TC6_Io(
4343 , CS_PIN
4444 , RESET_PIN
4545 , IRQ_PIN);
46- auto const tc6_inst = new TC6::TC6_Arduino_10BASE_T1S(tc6_io);
46+ TC6::TC6_Arduino_10BASE_T1S tc6_inst (tc6_io);
4747Arduino_10BASE_T1S_UDP udp_client;
4848
4949/* *************************************************************************************
@@ -61,19 +61,19 @@ void setup()
6161 */
6262 pinMode (IRQ_PIN, INPUT_PULLUP);
6363 attachInterrupt (digitalPinToInterrupt (IRQ_PIN),
64- []() { tc6_io-> onInterrupt (); },
64+ []() { tc6_io. onInterrupt (); },
6565 FALLING);
6666
6767 /* Initialize IO module. */
68- if (!tc6_io-> begin ())
68+ if (!tc6_io. begin ())
6969 {
7070 Serial.println (" 'TC6_Io::begin(...)' failed." );
7171 for (;;) { }
7272 }
7373
7474 MacAddress const mac_addr = MacAddress::create_from_uid ();
7575
76- if (!tc6_inst-> begin (ip_addr
76+ if (!tc6_inst. begin (ip_addr
7777 , network_mask
7878 , gateway
7979 , mac_addr
@@ -104,7 +104,7 @@ void loop()
104104 /* Services the hardware and the protocol stack.
105105 * Must be called cyclic. The faster the better.
106106 */
107- tc6_inst-> service ();
107+ tc6_inst. service ();
108108
109109 static unsigned long prev_beacon_check = 0 ;
110110 static unsigned long prev_udp_packet_sent = 0 ;
@@ -114,7 +114,7 @@ void loop()
114114 if ((now - prev_beacon_check) > 1000 )
115115 {
116116 prev_beacon_check = now;
117- if (!tc6_inst-> getPlcaStatus (OnPlcaStatus))
117+ if (!tc6_inst. getPlcaStatus (OnPlcaStatus))
118118 Serial.println (" getPlcaStatus(...) failed" );
119119 }
120120
@@ -189,6 +189,6 @@ static void OnPlcaStatus(bool success, bool plcaStatus)
189189 Serial.println (" PLCA Mode active" );
190190 else {
191191 Serial.println (" CSMA/CD fallback" );
192- tc6_inst-> enablePlca ();
192+ tc6_inst. enablePlca ();
193193 }
194194}
0 commit comments