feat(motor): 自适应 PDO 窗口与通道活动指示,新增原生 SOEM 时序诊断
后端 PDO 循环改为按在线槽收缩状态窗口,稀疏总线下单槽每周期都能刷新, 并补上尾部槽的发现扫描游标;新增自旋节拍源(阈值/显式覆盖)、P 核识别 与线程级钉核,自旋期间释放 GIL 以免 HTTP 线程被饿死;启动时先关停旧实例, 避免两个进程争用 Npcap 适配器。 记录每拍完整时间线、GC stop-the-world 事件与网格跳拍数,经 /api/motor/dbg 导出用于归因固定频率的超时;配
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Licensed under the GNU General Public License version 2 with exceptions. See
|
||||
* LICENSE file in the project root for full license information
|
||||
*/
|
||||
|
||||
#ifndef _osal_
|
||||
#define _osal_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#include "osal_defs.h"
|
||||
#include <stdint.h>
|
||||
|
||||
/* General types */
|
||||
#ifndef TRUE
|
||||
#define TRUE 1
|
||||
#endif
|
||||
#ifndef FALSE
|
||||
#define FALSE 0
|
||||
#endif
|
||||
typedef uint8_t boolean;
|
||||
typedef int8_t int8;
|
||||
typedef int16_t int16;
|
||||
typedef int32_t int32;
|
||||
typedef uint8_t uint8;
|
||||
typedef uint16_t uint16;
|
||||
typedef uint32_t uint32;
|
||||
typedef int64_t int64;
|
||||
typedef uint64_t uint64;
|
||||
typedef float float32;
|
||||
typedef double float64;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32 sec; /*< Seconds elapsed since the Epoch (Jan 1, 1970) */
|
||||
uint32 usec; /*< Microseconds elapsed since last second boundary */
|
||||
} ec_timet;
|
||||
|
||||
typedef struct osal_timer
|
||||
{
|
||||
ec_timet stop_time;
|
||||
} osal_timert;
|
||||
|
||||
void osal_timer_start(osal_timert * self, uint32 timeout_us);
|
||||
boolean osal_timer_is_expired(osal_timert * self);
|
||||
int osal_usleep(uint32 usec);
|
||||
ec_timet osal_current_time(void);
|
||||
void osal_time_diff(ec_timet *start, ec_timet *end, ec_timet *diff);
|
||||
int osal_thread_create(void *thandle, int stacksize, void *func, void *param);
|
||||
int osal_thread_create_rt(void *thandle, int stacksize, void *func, void *param);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user