统一跨平台时间函数接口。
This commit is contained in:
@@ -6,8 +6,8 @@
|
||||
#define _ADDITIONS_H_
|
||||
|
||||
#include <stdint.h>
|
||||
#include <sys/time.h>
|
||||
#include <serial/serial.h>
|
||||
#include <systime.h>
|
||||
#include <serial.h>
|
||||
#include <opencv2/core.hpp>
|
||||
|
||||
struct mcu_data {
|
||||
@@ -41,7 +41,7 @@ void extract(cv::Mat &gimbal_src, cv::Mat &chassis_src);
|
||||
|
||||
void extract(cv::Mat &gimbal_src);
|
||||
|
||||
double getTimeIntervalms(const timeval &now, const timeval &last);
|
||||
float getTimeIntervalms(const systime &now, const systime &last);
|
||||
|
||||
template<class type, int length>
|
||||
class RoundQueue {
|
||||
@@ -7,7 +7,7 @@
|
||||
#ifndef VIDEO_TEST1_CAMERA_WRAPPER_H
|
||||
#define VIDEO_TEST1_CAMERA_WRAPPER_H
|
||||
|
||||
#include <additions/additions.h>
|
||||
#include <additions.h>
|
||||
#include <opencv2/core/core.hpp>
|
||||
#include <camera/wrapper_head.h>
|
||||
|
||||
|
||||
23
others/include/systime.h
Normal file
23
others/include/systime.h
Normal file
@@ -0,0 +1,23 @@
|
||||
//
|
||||
// Created by xinyang on 19-7-31.
|
||||
//
|
||||
|
||||
#ifndef _PLATFORM_H_
|
||||
#define _PLATFORM_H_
|
||||
|
||||
typedef struct{
|
||||
int second;
|
||||
int millisecond;
|
||||
} systime;
|
||||
|
||||
void getsystime(systime &t);
|
||||
|
||||
#if defined(Linux)
|
||||
#include <sys/time.h>
|
||||
#elif defined(Windows)
|
||||
#include <Windows.h>
|
||||
#else
|
||||
#error "nonsupport platform."
|
||||
#endif
|
||||
|
||||
#endif /* _PLATFORM_H_ */
|
||||
Reference in New Issue
Block a user