forked from xuos/xiuos
merge codes
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
SRC_DIR :=
|
||||
|
||||
ifeq ($(CONFIG_ADD_XIUOS_FETURES),y)
|
||||
SRC_DIR += xiuos
|
||||
ifeq ($(CONFIG_ADD_XIZI_FETURES),y)
|
||||
SRC_DIR += xizi
|
||||
endif
|
||||
|
||||
include $(KERNEL_ROOT)/compiler.mk
|
||||
@@ -95,6 +95,12 @@ int PrivTaskDelay(int32_t ms)
|
||||
return usleep(ms);
|
||||
}
|
||||
|
||||
uint32_t PrivGetTickTime(){
|
||||
struct timespec ts;
|
||||
clock_gettime(CLOCK_MONOTONIC, &ts);
|
||||
return ts.tv_sec * 1000 + ts.tv_nsec / 1000000;
|
||||
}
|
||||
|
||||
/*********************fs**************************/
|
||||
|
||||
/************************Driver Posix Transform***********************/
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#ifndef TRANSFORM_H
|
||||
#define TRANSFORM_H
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <nuttx/pthread.h>
|
||||
#include <nuttx/semaphore.h>
|
||||
#include <nuttx/time.h>
|
||||
@@ -187,6 +188,7 @@ int PrivTaskStartup(pthread_t *thread);
|
||||
int PrivTaskDelete(pthread_t thread, int sig);
|
||||
void PrivTaskQuit(void *value_ptr);
|
||||
int PrivTaskDelay(int32_t ms);
|
||||
uint32_t PrivGetTickTime();
|
||||
|
||||
/*********************driver*************************/
|
||||
|
||||
|
||||
@@ -101,6 +101,11 @@ int PrivTaskDelay(int32_t ms)
|
||||
rt_thread_mdelay(ms);
|
||||
}
|
||||
|
||||
uint32_t PrivGetTickTime()
|
||||
{
|
||||
return rt_tick_get_millisecond();
|
||||
}
|
||||
|
||||
/*********************fs**************************/
|
||||
|
||||
/************************Driver Posix Transform***********************/
|
||||
|
||||
@@ -179,6 +179,7 @@ int PrivTaskStartup(pthread_t *thread);
|
||||
int PrivTaskDelete(pthread_t thread, int sig);
|
||||
void PrivTaskQuit(void *value_ptr);
|
||||
int PrivTaskDelay(int32_t ms);
|
||||
uint32_t PrivGetTickTime();
|
||||
|
||||
/*********************driver*************************/
|
||||
|
||||
|
||||
@@ -102,6 +102,11 @@ int PrivTaskDelay(int32_t ms)
|
||||
UserTaskDelay(ms);
|
||||
}
|
||||
|
||||
uint32_t PrivGetTickTime()
|
||||
{
|
||||
return CalculteTimeMsFromTick(CurrentTicksGain());
|
||||
}
|
||||
|
||||
/*********************fs**************************/
|
||||
#ifdef FS_VFS
|
||||
/************************Driver Posix Transform***********************/
|
||||
@@ -207,6 +207,7 @@ int PrivTaskDelete(pthread_t thread, int sig);
|
||||
void PrivTaskQuit(void *value_ptr);
|
||||
int PrivTaskDelay(int32_t ms);
|
||||
int PrivUserTaskSearch(void);
|
||||
uint32_t PrivGetTickTime();
|
||||
|
||||
/*********************driver*************************/
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
#ifdef SEPARATE_COMPILE
|
||||
|
||||
#include "../../../../../../Ubiquitous/XiUOS/arch/kswitch.h"
|
||||
#include "../../../../../../Ubiquitous/XiZi/arch/kswitch.h"
|
||||
|
||||
#define TASK_INFO 1
|
||||
#define MEM_INFO 2
|
||||
@@ -158,14 +158,13 @@ int statfs(const char *path, struct statfs *buf);
|
||||
|
||||
/* NOTE!!!: when cutting out file system, the 'printf' function can not output angthing */
|
||||
int Userprintf(const char *fmt, ...);
|
||||
#define printf Userprintf
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#else
|
||||
|
||||
#include <xiuos.h>
|
||||
#include <xizi.h>
|
||||
|
||||
#ifdef FS_VFS
|
||||
#include <iot-vfs_posix.h>
|
||||
@@ -242,7 +241,6 @@ uint8_t UserGetTaskPriority(int32_t id);
|
||||
#endif
|
||||
|
||||
#define UserPrintf KPrintf
|
||||
#define printf KPrintf
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user