-
大小: 737KB文件類型: .zip金幣: 2下載: 0 次發(fā)布日期: 2021-06-03
- 語言: 其他
- 標簽:
資源簡介
EtherCAT開源主站SOEM,1.3.0版本,可以在這個基礎(chǔ)上直接進行主站開發(fā)

代碼片段和文件信息
/******************************************************************************
?*????????????????*??????????***????????????????????***
?*??????????????***??????????***????????????????????***
?*?***??****??**********?????***????????*****???????***??****??????????*****
?*?*********??**********?????***??????*********?????************?????*********
?*?****?????????***??????????***??????????????***???***???????****???***
?*?***??????????***??******??***??????***********???***????????****???*****
?*?***??????????***??******??***????*************???***????????****??????*****
?*?***??????????****?????????****???***???????***???***???????****??????????***
?*?***???????????*******??????*****?**************??*************????*********
?*?***?????????????*****????????***???*******???**??**??******?????????*****
?*???????????????????????????t?h?e??r?e?a?l?t?i?m?e??t?a?r?g?e?t??e?x?p?e?r?t?s
?*
?*?http://www.rt-labs.com
?*?Copyright?(C)?2009.?rt-labs?AB?Sweden.?All?rights?reserved.
?*------------------------------------------------------------------------------
?*?$Id:?osal.c?416?2013-01-08?21:54:25Z?smf.arthur?$
?*------------------------------------------------------------------------------
?*/
#include?
#include?
#include?
#include?
#define?USECS_PER_SEC?????1000000
int?osal_usleep?(uint32?usec)
{
???struct?timespec?ts;
???ts.tv_sec?=?usec?/?USECS_PER_SEC;
???ts.tv_nsec?=?(usec?%?USECS_PER_SEC)?*?1000;
???/*?usleep?is?depricated?use?nanosleep?instead?*/
???return?nanosleep(&ts?NULL);
}
int?osal_gettimeofday(struct?timeval?*tv?struct?timezone?*tz)
{
???struct?timespec?ts;
???int?return_value;
???
???/*?Use?clock_gettime?to?prevent?possible?live-lock.
????*?Gettimeofday?uses?CLOCK_REALTIME?that?can?get?NTP?timeadjust.
????*?If?this?function?preempts?timeadjust?and?it?uses?vpage?it?live-locks.
????*?Also?when?using?XENOMAI?only?clock_gettime?is?RT?safe?*/
???return_value?=?clock_gettime?(CLOCK_MONOTONIC?&ts)?0;
???tv->tv_sec?=?ts.tv_sec;
???tv->tv_usec?=?ts.tv_nsec?/?1000;
???return?return_value;
}
ec_timet?osal_current_time?(void)
{
???struct?timeval?current_time;
???ec_timet?return_value;
???osal_gettimeofday?(¤t_time?0);
???return_value.sec?=?current_time.tv_sec;
???return_value.usec?=?current_time.tv_usec;
???return?return_value;
}
void?osal_timer_start?(osal_timert?*?self?uint32?timeout_usec)
{
???struct?timeval?start_time;
???struct?timeval?timeout;
???struct?timeval?stop_time;
???osal_gettimeofday?(&start_time?0);
???timeout.tv_sec?=?timeout_usec?/?USECS_PER_SEC;
???timeout.tv_usec?=?timeout_usec?%?USECS_PER_SEC;
???timeradd?(&start_time?&timeout?&stop_time);
???self->stop_time.sec?=?stop_time.tv_sec;
???self->stop_time.usec?=?stop_time.tv_usec;
}
boolean?osal_timer_is_expired?(const?osal_timert?*?self)
{
???struct?timeval?current_time;
???struct?timeval?stop_time;
???int?is_not_yet_expired;
???osal_getti
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????3604??2013-02-27?05:07??ChangeLog
?????文件?????????162??2013-02-27?05:07??clean_libsoem_lib.bat
?????文件????????1120??2013-02-27?05:07??clean_test_win32.bat
?????目錄???????????0??2013-02-27?05:15??doc\
?????目錄???????????0??2013-02-27?05:15??doc\html\
?????文件???????13262??2013-02-27?05:07??doc\html\annotated.html
?????文件?????????676??2013-02-27?05:07??doc\html\bc_s.png
?????文件?????????147??2013-02-27?05:07??doc\html\bdwn.png
?????文件????????7513??2013-02-27?05:07??doc\html\classes.html
?????文件?????????132??2013-02-27?05:07??doc\html\closed.png
?????文件???????20452??2013-02-27?05:07??doc\html\doxygen.css
?????文件????????3779??2013-02-27?05:07??doc\html\doxygen.png
?????文件????????2983??2013-02-27?05:07??doc\html\dynsections.js
?????文件???????30097??2013-02-27?05:07??doc\html\ebox_8c.html
?????文件???????33424??2013-02-27?05:07??doc\html\eepromtool_8c.html
?????文件???????83347??2013-02-27?05:07??doc\html\ethercatba
?????文件???????53160??2013-02-27?05:07??doc\html\ethercatba
?????文件???????61801??2013-02-27?05:07??doc\html\ethercatcoe_8c.html
?????文件???????36851??2013-02-27?05:07??doc\html\ethercatcoe_8h.html
?????文件????????8799??2013-02-27?05:07??doc\html\ethercatconfiglist_8h.html
?????文件???????24180??2013-02-27?05:07??doc\html\ethercatconfig_8c.html
?????文件???????12295??2013-02-27?05:07??doc\html\ethercatconfig_8h.html
?????文件???????22878??2013-02-27?05:07??doc\html\ethercatdc_8c.html
?????文件????????9817??2013-02-27?05:07??doc\html\ethercatdc_8h.html
?????文件???????17794??2013-02-27?05:07??doc\html\ethercatfoe_8c.html
?????文件???????11097??2013-02-27?05:07??doc\html\ethercatfoe_8h.html
?????文件??????158998??2013-02-27?05:07??doc\html\ethercatmain_8c.html
?????文件??????101646??2013-02-27?05:07??doc\html\ethercatmain_8h.html
?????文件???????34852??2013-02-27?05:07??doc\html\ethercatprint_8c.html
?????文件????????7470??2013-02-27?05:07??doc\html\ethercatprint_8h.html
?????文件???????21863??2013-02-27?05:07??doc\html\ethercatsoe_8c.html
............此處省略315個文件信息
- 上一篇:工程數(shù)學課后答案全版.pdf
- 下一篇:STM32Pack支持包
評論
共有 條評論