Skip to content

Commit 447568c

Browse files
committed
c33: eth: move clock pins to variant
1 parent 667009a commit 447568c

File tree

3 files changed

+23
-8
lines changed

3 files changed

+23
-8
lines changed

Diff for: libraries/Ethernet/src/EthernetClock.cpp

+19-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include "EthernetClock.h"
2+
#include "pins_arduino.h"
23

3-
4+
#if defined(ETHERNET_CLK_PIN)
45

56
EthernetClock::EthernetClock() {
67
pinPeripheral(ETHERNET_CLK_PIN, (uint32_t) (IOPORT_CFG_PERIPHERAL_PIN | IOPORT_PERIPHERAL_AGT));
@@ -18,7 +19,7 @@ EthernetClock::EthernetClock() {
1819
this->TIMER_ETHERNET_cfg.period_counts = (uint32_t) 0x1;
1920
this->TIMER_ETHERNET_cfg.duty_cycle_counts = 0x00;
2021
this->TIMER_ETHERNET_cfg.source_div = (timer_source_div_t) 0;
21-
this->TIMER_ETHERNET_cfg.channel = AGT_TIMER_CHANNEL;
22+
this->TIMER_ETHERNET_cfg.channel = ETHERNET_AGT_TIMER_CHANNEL;
2223
this->TIMER_ETHERNET_cfg.p_callback = NULL;
2324
this->TIMER_ETHERNET_cfg.p_context = NULL;
2425
this->TIMER_ETHERNET_cfg.p_extend = &TIMER_ETHERNET_extend;
@@ -40,7 +41,7 @@ fsp_err_t EthernetClock::start() {
4041
return err;
4142
}
4243

43-
FspTimer::set_timer_is_used(AGT_TIMER, AGT_TIMER_CHANNEL);
44+
FspTimer::set_timer_is_used(AGT_TIMER, ETHERNET_AGT_TIMER_CHANNEL);
4445
return err;
4546
}
4647

@@ -60,3 +61,18 @@ fsp_err_t EthernetClock::stop() {
6061
}
6162
}
6263
}
64+
65+
#else
66+
67+
EthernetClock::EthernetClock() {
68+
}
69+
70+
fsp_err_t EthernetClock::start() {
71+
return FSP_SUCCESS;
72+
}
73+
74+
fsp_err_t EthernetClock::stop() {
75+
return FSP_SUCCESS;
76+
}
77+
78+
#endif

Diff for: libraries/Ethernet/src/EthernetClock.h

-4
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@
44

55
#include "FspTimer.h"
66

7-
#define AGT_TIMER_CHANNEL 3
8-
#define ETHERNET_CLK_PIN BSP_IO_PORT_06_PIN_00
9-
10-
117
class EthernetClock {
128
public:
139
EthernetClock();

Diff for: variants/PORTENTA_C33/pins_arduino.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -208,4 +208,7 @@ static const uint8_t SS = PIN_SPI_CS;
208208

209209
#define RTC_CLOCK_SOURCE RTC_CLOCK_SOURCE_SUBCLK
210210

211-
#define AR_INTERNAL_VOLTAGE 1.18f
211+
#define AR_INTERNAL_VOLTAGE 1.18f
212+
213+
#define ETHERNET_AGT_TIMER_CHANNEL 3
214+
#define ETHERNET_CLK_PIN BSP_IO_PORT_06_PIN_00

0 commit comments

Comments
 (0)