chw 's change

This commit is contained in:
chw
2020-09-29 14:55:22 +08:00
parent 358c940763
commit 43f126635c
10 changed files with 70 additions and 10 deletions

36
build/rules-arm.freertos Normal file
View File

@@ -0,0 +1,36 @@
# set your own targaet_os
TARGET_OS=freertos
##################################################
# set your compile tool #
CC=arm-linux-gnueabihf-gcc
CXX=arm-linux-gnueabihf-g++
CPP=arm-linux-gnueabihf-g++
AR=arm-linux-gnueabihf-ar
AS=arm-linux-gnueabihf-as
RANLIB=arm-linux-gnueabihf-ranlib
MAKE=/usr/bin/make
##################################################
ARFLAGS=-rc
COFLAG=-c
OBJ=o
LIBA=a
##################################################
# if you don't want to create dynamic, delete it #
LIBSO=so
SOFLAGS=-fPIC -shared -o
##################################################
##################################################
# set your compile flags and install prefix path #
PREFIX=/usr/local
CFLAGS+=-g -Wall -fPIC
LDFLAGS+=
##################################################

View File

@@ -94,7 +94,7 @@ osname="unspecified"
runtime_mode="procs"
compositing_schema="no"
virtual_window="no"
use_shmopen="yes"
use_shmopen="no"
mgslice_use_fallback="no"
incore_res="no"

View File

@@ -15,7 +15,7 @@ libkernel_la_SOURCES = timer.c \
desktop-ths.c desktop-sa.c desktop-procs.c \
cursor.c cursor-procs.c cursor-sa.c \
sharedres.c \
message.c event.c \
message.c event.c listenfd.c \
blockheap.c fixstr.c slotset.c zorder.c
endif

View File

@@ -362,7 +362,7 @@ static void mg_slice_init_nomessage (void)
sys_page_size = system_info.dwPageSize;
}
#else
sys_page_size = sysconf (_SC_PAGESIZE); /* = sysconf (_SC_PAGE_SIZE); = getpagesize(); */
sys_page_size = getpagesize(); /* = sysconf (_SC_PAGE_SIZE); = getpagesize(); */
#endif
mem_assert (sys_page_size >= 2 * LARGEALIGNMENT);
mem_assert ((sys_page_size & (sys_page_size - 1)) == 0);

View File

@@ -13,6 +13,7 @@ MINIGUILIB=libminigui-$(MINIGUI_VER)
# specific defines
COMM_LDADD= \
standalone/libstandalone.$(LIBA) \
libc/liblibc.$(LIBA) \
misc/libmisc.$(LIBA) \
control/libcontrol.$(LIBA) \

View File

@@ -4,17 +4,17 @@ INCLUDES = -I$(abs_top_srcdir)/include -I$(abs_top_srcdir)/src/include
noinst_LTLIBRARIES = libmisc.la
EXTRA_DIST= misc.c systext.c rwops.c endianrw.c nposix.c clipboard.c \
math.c about.c error.c sockio.c listenfd.c rc4.c rc4.h \
math.c about.c error.c sockio.c rc4.c rc4.h \
makefile.ng makefile.msvc
LITE_SRCS=error.c sockio.c listenfd.c
LITE_SRCS=error.c sockio.c
ifdef MG_MINIMALGDI
libmisc_la_SOURCES = misc.c math.c rwops.c nposix.c
else
libmisc_la_SOURCES = misc.c systext.c rwops.c endianrw.c nposix.c clipboard.c \
math.c about.c license.c \
math.c about.c license.c anon_file.c rbtree.c map.c \
$(LITE_SRCS)
endif

View File

@@ -414,6 +414,7 @@ unsigned int __mg_os_get_random_seed (void)
unsigned int rt_tick_get(void);
return rt_tick_get();
#elif defined (__FREERTOS__)
return 0;
#else
/*other os use time, for example: linux, OSE, etc.*/
return time (NULL);
@@ -451,7 +452,9 @@ void __mg_os_time_delay (int ms)
extern int rt_thread_mdelay(int ms);
rt_thread_mdelay(ms);
#elif defined (__FREERTOS__)
#error "Please implement __mg_os_time_delay for your OS"
//#error "Please implement __mg_os_time_delay for your OS"
extern void vTaskDelay( int xTicksToDelay );
vTaskDelay(ms);
#else
#error "Please implement __mg_os_time_delay for your OS"
#endif

View File

@@ -0,0 +1,16 @@
abs_top_srcdir=../..
INCLUDES = -I$(abs_top_srcdir)/src/include -I$(abs_top_srcdir)/include
noinst_LTLIBRARIES = libstandalone.la
libstandalone_la_SOURCES = standalone.c
SRC_FILES = $(libstandalone_la_SOURCES)
LIB_NAME=libstandalone
include ../../rules.make

View File

@@ -70,10 +70,10 @@ static char* _system_keys[]={
};
static char* _system_values[]={
// GAL engine and default options
"pc_xvfb",
"800x600-16bpp",
"commlcd",
"160x80-16bpp",
// IAL engine
"pc_xvfb",
"comm",
"/dev/input/mice",
"IMPS2"
};

View File

@@ -646,9 +646,13 @@ static char* get_res_file(const char* res_name, char* filename)
#else
sprintf(filename,"%s/%s", res_paths[i], res_name);
#ifndef __VXWORKS__
#ifdef __FREERTOS__
if (access(filename, 04) != -1)
#else
//in vxworks, don't support _access method.
if (_access(filename, 04) != -1)
#endif
#endif
#endif
{
return filename;