1
1
#include " EthernetClock.h"
2
+ #include " pins_arduino.h"
2
3
3
-
4
+ # if defined(ETHERNET_CLK_PIN)
4
5
5
6
EthernetClock::EthernetClock () {
6
7
pinPeripheral (ETHERNET_CLK_PIN, (uint32_t ) (IOPORT_CFG_PERIPHERAL_PIN | IOPORT_PERIPHERAL_AGT));
@@ -18,7 +19,7 @@ EthernetClock::EthernetClock() {
18
19
this ->TIMER_ETHERNET_cfg .period_counts = (uint32_t ) 0x1 ;
19
20
this ->TIMER_ETHERNET_cfg .duty_cycle_counts = 0x00 ;
20
21
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 ;
22
23
this ->TIMER_ETHERNET_cfg .p_callback = NULL ;
23
24
this ->TIMER_ETHERNET_cfg .p_context = NULL ;
24
25
this ->TIMER_ETHERNET_cfg .p_extend = &TIMER_ETHERNET_extend;
@@ -40,7 +41,7 @@ fsp_err_t EthernetClock::start() {
40
41
return err;
41
42
}
42
43
43
- FspTimer::set_timer_is_used (AGT_TIMER, AGT_TIMER_CHANNEL );
44
+ FspTimer::set_timer_is_used (AGT_TIMER, ETHERNET_AGT_TIMER_CHANNEL );
44
45
return err;
45
46
}
46
47
@@ -60,3 +61,18 @@ fsp_err_t EthernetClock::stop() {
60
61
}
61
62
}
62
63
}
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
0 commit comments