summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernard Xiong <[email protected]>2017-12-14 10:46:54 +0800
committerGitHub <[email protected]>2017-12-14 10:46:54 +0800
commitd50e963125ea2da55d1636c567f5c253c35c8d82 (patch)
treeb3218f5700f33e75b5eabce06e9ebc955a7c2de4
parentb0f4ae246a7a0d958777e11ad2392f22f20a99e6 (diff)
parentc4b6fa797890add7fe41be72f869e9ff2a0e3a76 (diff)
Merge pull request #1105 from BernardXiong/master
[BSP] fix the issues in simulator for WIN32.
-rw-r--r--.gitignore1
-rw-r--r--bsp/simulator/.config12
-rw-r--r--bsp/simulator/.gitignore4
-rw-r--r--bsp/simulator/drivers/dfs_win32.c4
-rwxr-xr-xbsp/simulator/rtconfig.h8
-rw-r--r--bsp/simulator/rtconfig_project.h2
-rw-r--r--components/gui/include/rtgui/color.h2
-rw-r--r--include/libc/libc_stat.h31
8 files changed, 55 insertions, 9 deletions
diff --git a/.gitignore b/.gitignore
index f09594098c..681849701b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -23,3 +23,4 @@ documentation/html
*.i
*.d
tools/kconfig-frontends/kconfig-mconf
+packages
diff --git a/bsp/simulator/.config b/bsp/simulator/.config
index 3a1c2b0908..59895c70dd 100644
--- a/bsp/simulator/.config
+++ b/bsp/simulator/.config
@@ -59,7 +59,7 @@ CONFIG_RT_CONSOLE_DEVICE_NAME="console"
#
# C++ features
#
-CONFIG_RT_USING_CPLUSPLUS=y
+# CONFIG_RT_USING_CPLUSPLUS is not set
#
# Command shell
@@ -189,6 +189,7 @@ CONFIG_RTGUI_USING_DEMO=y
# system packages
#
# CONFIG_PKG_USING_PARTITION is not set
+CONFIG_RT_USING_PERSIMMON_EXAMPLE=y
# CONFIG_PKG_USING_SQLITE is not set
# CONFIG_PKG_USING_RTI is not set
@@ -232,7 +233,9 @@ CONFIG_RTGUI_USING_DEMO=y
#
# miscellaneous packages
#
-# CONFIG_PKG_USING_FASTLZ is not set
+CONFIG_PKG_USING_FASTLZ=y
+CONFIG_PKG_FASTLZ_PATH="/packages/misc/fastlz"
+CONFIG_PKG_FASTLZ_VER="v1.0.0"
# CONFIG_PKG_USING_MINILZO is not set
#
@@ -245,6 +248,11 @@ CONFIG_RTGUI_USING_DEMO=y
#
# CONFIG_PKG_USING_CODEC is not set
# CONFIG_PKG_USING_PLAYER is not set
+CONFIG_PKG_USING_PERSIMMON_SRC=y
+CONFIG_PKG_PERSIMMON_SRC_PATH="/realthread-packages/persimmon-src"
+# CONFIG_PKG_USING_PERSIMMON_SRC_v1_0_0 is not set
+CONFIG_PKG_USING_PERSIMMON_LATEST_VERSION=y
+CONFIG_PKG_PERSIMMON_SRC_VER="latest_version"
#
# Network Utilities
diff --git a/bsp/simulator/.gitignore b/bsp/simulator/.gitignore
index fef6f4cbc8..8f4c8bfe54 100644
--- a/bsp/simulator/.gitignore
+++ b/bsp/simulator/.gitignore
@@ -42,6 +42,10 @@ _UpgradeReport_Files
*.ncb
*.suo
*.exp
+*.sdf
*.XML
*.user
*.def
+Backup*
+UpgradeLog*
+*.filters
diff --git a/bsp/simulator/drivers/dfs_win32.c b/bsp/simulator/drivers/dfs_win32.c
index b868d421f9..b275751efb 100644
--- a/bsp/simulator/drivers/dfs_win32.c
+++ b/bsp/simulator/drivers/dfs_win32.c
@@ -26,7 +26,7 @@
#include <stdio.h>
#include <string.h>
#include <WinError.h>
-#include <windows.h>
+#include <windows.h>
#if defined(__MINGW32__) && defined(_NO_OLDNAMES)
#define O_RDONLY _O_RDONLY
@@ -49,7 +49,7 @@
*/
#define FILE_PATH_MAX 256 /* the longest file path */
-#define WIN32_DIRDISK_ROOT "./disk" /* "F:\\Project\\svn\\rtt\\trunk\\bsp\\simulator_test" */
+#define WIN32_DIRDISK_ROOT "./disk"
typedef struct {
HANDLE handle;
diff --git a/bsp/simulator/rtconfig.h b/bsp/simulator/rtconfig.h
index 84610f07a8..778e3f7d61 100755
--- a/bsp/simulator/rtconfig.h
+++ b/bsp/simulator/rtconfig.h
@@ -54,7 +54,7 @@
/* C++ features */
-#define RT_USING_CPLUSPLUS
+/* RT_USING_CPLUSPLUS is not set */
/* Command shell */
@@ -168,6 +168,7 @@
/* system packages */
/* PKG_USING_PARTITION is not set */
+#define RT_USING_PERSIMMON_EXAMPLE
/* PKG_USING_SQLITE is not set */
/* PKG_USING_RTI is not set */
@@ -205,7 +206,7 @@
/* miscellaneous packages */
-/* PKG_USING_FASTLZ is not set */
+#define PKG_USING_FASTLZ
/* PKG_USING_MINILZO is not set */
/* example package: hello */
@@ -216,6 +217,9 @@
/* PKG_USING_CODEC is not set */
/* PKG_USING_PLAYER is not set */
+#define PKG_USING_PERSIMMON_SRC
+/* PKG_USING_PERSIMMON_SRC_v1_0_0 is not set */
+#define PKG_USING_PERSIMMON_LATEST_VERSION
/* Network Utilities */
diff --git a/bsp/simulator/rtconfig_project.h b/bsp/simulator/rtconfig_project.h
index bdf1792cd1..02e29c1a65 100644
--- a/bsp/simulator/rtconfig_project.h
+++ b/bsp/simulator/rtconfig_project.h
@@ -1,7 +1,7 @@
#ifndef RTCONFIG_PROJECT_H__
#define RTCONFIG_PROJECT_H__
-#define RT_HEAP_SIZE (1024*1024*2)
+#define RT_HEAP_SIZE (1024*1024*8)
#if defined(_MSC_VER)
#define NORESOURCE //RT_VESRION in winuser.h
diff --git a/components/gui/include/rtgui/color.h b/components/gui/include/rtgui/color.h
index f47189bd84..f3c232e241 100644
--- a/components/gui/include/rtgui/color.h
+++ b/components/gui/include/rtgui/color.h
@@ -72,7 +72,7 @@ extern const rtgui_color_t default_background;
#ifdef TRANSPARENT
#undef TRANSPARENT
-#define TRANSPARENT 0
+#define TRANSPARENT RTGUI_ARGB(0, 0, 0, 0)
#endif
extern const rtgui_color_t red;
diff --git a/include/libc/libc_stat.h b/include/libc/libc_stat.h
index 36ccd322d5..69871dd101 100644
--- a/include/libc/libc_stat.h
+++ b/include/libc/libc_stat.h
@@ -3,9 +3,38 @@
#include <rtconfig.h>
-#ifdef RT_USING_NEWLIB
+#if defined(RT_USING_NEWLIB)
/* use header file of newlib */
#include <sys/stat.h>
+
+#elif defined(_WIN32)
+#include <sys/stat.h>
+
+#define S_IRWXU 00700
+#define S_IRUSR 00400
+#define S_IWUSR 00200
+#define S_IXUSR 00100
+
+#define S_IRWXG 00070
+#define S_IRGRP 00040
+#define S_IWGRP 00020
+#define S_IXGRP 00010
+
+#define S_IRWXO 00007
+#define S_IROTH 00004
+#define S_IWOTH 00002
+#define S_IXOTH 00001
+
+#define S_IFSOCK 0140000
+#define S_IFLNK 0120000
+#define S_IFBLK 0060000
+#define S_IFIFO 0010000
+#define S_ISUID 0004000
+#define S_ISGID 0002000
+#define S_ISVTX 0001000
+
+#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
+
#else
#define S_IFMT 00170000
#define S_IFSOCK 0140000