From 43f126635cd2ff3bd3aa832684afa8bd8e43720f Mon Sep 17 00:00:00 2001 From: chw <1062347630@qq.com> Date: Tue, 29 Sep 2020 14:55:22 +0800 Subject: [PATCH] chw 's change --- build/rules-arm.freertos | 36 ++++++++++++++++++++++++++++++++++++ configure.ac | 2 +- src/kernel/makefile.ng | 2 +- src/libc/mgslice.c | 2 +- src/makefile.ng | 1 + src/misc/makefile.ng | 6 +++--- src/misc/nposix.c | 5 ++++- src/standalone/makefile.ng | 16 ++++++++++++++++ src/sysres/mgetc.c | 6 +++--- src/sysres/resmgr.c | 4 ++++ 10 files changed, 70 insertions(+), 10 deletions(-) create mode 100644 build/rules-arm.freertos create mode 100644 src/standalone/makefile.ng diff --git a/build/rules-arm.freertos b/build/rules-arm.freertos new file mode 100644 index 00000000..cd8e0d5b --- /dev/null +++ b/build/rules-arm.freertos @@ -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+= +################################################## + diff --git a/configure.ac b/configure.ac index 959f3149..b0498c5c 100644 --- a/configure.ac +++ b/configure.ac @@ -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" diff --git a/src/kernel/makefile.ng b/src/kernel/makefile.ng index f055e0e6..e040e850 100644 --- a/src/kernel/makefile.ng +++ b/src/kernel/makefile.ng @@ -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 diff --git a/src/libc/mgslice.c b/src/libc/mgslice.c index 59c81bb4..4599bfd9 100644 --- a/src/libc/mgslice.c +++ b/src/libc/mgslice.c @@ -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); diff --git a/src/makefile.ng b/src/makefile.ng index b548f985..e666c457 100644 --- a/src/makefile.ng +++ b/src/makefile.ng @@ -13,6 +13,7 @@ MINIGUILIB=libminigui-$(MINIGUI_VER) # specific defines COMM_LDADD= \ + standalone/libstandalone.$(LIBA) \ libc/liblibc.$(LIBA) \ misc/libmisc.$(LIBA) \ control/libcontrol.$(LIBA) \ diff --git a/src/misc/makefile.ng b/src/misc/makefile.ng index b3517691..1ad9eba8 100644 --- a/src/misc/makefile.ng +++ b/src/misc/makefile.ng @@ -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 diff --git a/src/misc/nposix.c b/src/misc/nposix.c index 1705babb..2a6291a1 100644 --- a/src/misc/nposix.c +++ b/src/misc/nposix.c @@ -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 diff --git a/src/standalone/makefile.ng b/src/standalone/makefile.ng new file mode 100644 index 00000000..6cab16dc --- /dev/null +++ b/src/standalone/makefile.ng @@ -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 \ No newline at end of file diff --git a/src/sysres/mgetc.c b/src/sysres/mgetc.c index 8428b09a..11b0a2fa 100644 --- a/src/sysres/mgetc.c +++ b/src/sysres/mgetc.c @@ -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" }; diff --git a/src/sysres/resmgr.c b/src/sysres/resmgr.c index e9d0ad7f..f1e4aaf2 100644 --- a/src/sysres/resmgr.c +++ b/src/sysres/resmgr.c @@ -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;