mirror of
https://gitee.com/Vancouver2017/luban-lite-t3e-pro.git
synced 2025-12-14 18:38:55 +00:00
30 lines
653 B
C
30 lines
653 B
C
/* startup.c */
|
|
|
|
#include "../ptpd.h"
|
|
|
|
void ptpdShutdown(PtpClock *ptpClock)
|
|
{
|
|
netShutdown(&ptpClock->netPath);
|
|
}
|
|
|
|
int16_t ptpdStartup(PtpClock * ptpClock, RunTimeOpts *rtOpts, ForeignMasterRecord* foreign)
|
|
{
|
|
ptpClock->rtOpts = rtOpts;
|
|
ptpClock->foreignMasterDS.records = foreign;
|
|
|
|
/* 9.2.2 */
|
|
if (rtOpts->slaveOnly) rtOpts->clockQuality.clockClass = DEFAULT_CLOCK_CLASS_SLAVE_ONLY;
|
|
|
|
/* No negative or zero attenuation */
|
|
if (rtOpts->servo.ap < 1) rtOpts->servo.ap = 1;
|
|
if (rtOpts->servo.ai < 1) rtOpts->servo.ai = 1;
|
|
|
|
DBG("event POWER UP\n");
|
|
|
|
ETH_PTPStart();
|
|
|
|
toState(ptpClock, PTP_INITIALIZING);
|
|
|
|
return 0;
|
|
}
|