mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 14:27:37 +08:00
Misc changes to accept setenv.bat; Add UG-2864AMBAG01 reverse landscape support
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5326 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
@@ -53,10 +53,28 @@ config WINDOWS_MSYS
|
|||||||
bool "MSYS"
|
bool "MSYS"
|
||||||
|
|
||||||
config WINDOWS_OTHER
|
config WINDOWS_OTHER
|
||||||
bool "Other"
|
bool "Other POSIX-like environment"
|
||||||
|
|
||||||
endchoice
|
endchoice
|
||||||
|
|
||||||
|
config WINDOWS_MKLINK
|
||||||
|
bool "Use mklink"
|
||||||
|
default y
|
||||||
|
depends on HOST_WINDOWS
|
||||||
|
---help---
|
||||||
|
Use the mklink command to set up symbolic links when NuttX is
|
||||||
|
configured. Otherwise, configuration directories will be copied to
|
||||||
|
establish the configuration.
|
||||||
|
|
||||||
|
If directories are copied, then some confusion can result ("Which
|
||||||
|
version of the file did I modify?"). In that case, it is recommended
|
||||||
|
that you re-build using 'make clean_context all'. That will cause the
|
||||||
|
configured directories to be recopied on each build.
|
||||||
|
|
||||||
|
NOTE: This option also (1) that you have administrator privileges, (2)
|
||||||
|
that you are using Windows 2000 or better, and (3) that you are using
|
||||||
|
the NTFS file system. Select 'n' is that is not the case.
|
||||||
|
|
||||||
menu "Build Configuration"
|
menu "Build Configuration"
|
||||||
|
|
||||||
config APPS_DIR
|
config APPS_DIR
|
||||||
|
|||||||
@@ -153,6 +153,8 @@
|
|||||||
# undef CONFIG_LCD_PORTRAIT
|
# undef CONFIG_LCD_PORTRAIT
|
||||||
# undef CONFIG_LCD_RLANDSCAPE
|
# undef CONFIG_LCD_RLANDSCAPE
|
||||||
# undef CONFIG_LCD_RPORTRAIT
|
# undef CONFIG_LCD_RPORTRAIT
|
||||||
|
#elif defined(CONFIG_LCD_RLANDSCAPE)
|
||||||
|
# warning "Reverse landscape mode is untested and, hence, probably buggy"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* SH1101A Commands *******************************************************************/
|
/* SH1101A Commands *******************************************************************/
|
||||||
@@ -574,7 +576,11 @@ static int ug2864ambag01_putrun(fb_coord_t row, fb_coord_t col, FAR const uint8_
|
|||||||
|
|
||||||
fbmask = 1 << (row & 7);
|
fbmask = 1 << (row & 7);
|
||||||
fbptr = &priv->fb[page * UG2864AMBAG01_XRES + col];
|
fbptr = &priv->fb[page * UG2864AMBAG01_XRES + col];
|
||||||
|
#ifdef CONFIG_LCD_RLANDSCAPE
|
||||||
|
ptr = fbptr + pixlen - 1;
|
||||||
|
#else
|
||||||
ptr = fbptr;
|
ptr = fbptr;
|
||||||
|
#endif
|
||||||
#ifdef CONFIG_NX_PACKEDMSFIRST
|
#ifdef CONFIG_NX_PACKEDMSFIRST
|
||||||
usrmask = MS_BIT;
|
usrmask = MS_BIT;
|
||||||
#else
|
#else
|
||||||
@@ -585,6 +591,16 @@ static int ug2864ambag01_putrun(fb_coord_t row, fb_coord_t col, FAR const uint8_
|
|||||||
{
|
{
|
||||||
/* Set or clear the corresponding bit */
|
/* Set or clear the corresponding bit */
|
||||||
|
|
||||||
|
#ifdef CONFIG_LCD_RLANDSCAPE
|
||||||
|
if ((*buffer & usrmask) != 0)
|
||||||
|
{
|
||||||
|
*ptr-- |= fbmask;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
*ptr-- &= ~fbmask;
|
||||||
|
}
|
||||||
|
#else
|
||||||
if ((*buffer & usrmask) != 0)
|
if ((*buffer & usrmask) != 0)
|
||||||
{
|
{
|
||||||
*ptr++ |= fbmask;
|
*ptr++ |= fbmask;
|
||||||
@@ -593,6 +609,7 @@ static int ug2864ambag01_putrun(fb_coord_t row, fb_coord_t col, FAR const uint8_
|
|||||||
{
|
{
|
||||||
*ptr++ &= ~fbmask;
|
*ptr++ &= ~fbmask;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Inc/Decrement to the next source pixel */
|
/* Inc/Decrement to the next source pixel */
|
||||||
|
|
||||||
@@ -748,7 +765,11 @@ static int ug2864ambag01_getrun(fb_coord_t row, fb_coord_t col, FAR uint8_t *buf
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
fbmask = 1 << (row & 7);
|
fbmask = 1 << (row & 7);
|
||||||
|
#ifdef CONFIG_LCD_RLANDSCAPE
|
||||||
|
fbptr = &priv->fb[page * (UG2864AMBAG01_XRES-1) + col + pixlen];
|
||||||
|
#else
|
||||||
fbptr = &priv->fb[page * UG2864AMBAG01_XRES + col];
|
fbptr = &priv->fb[page * UG2864AMBAG01_XRES + col];
|
||||||
|
#endif
|
||||||
#ifdef CONFIG_NX_PACKEDMSFIRST
|
#ifdef CONFIG_NX_PACKEDMSFIRST
|
||||||
usrmask = MS_BIT;
|
usrmask = MS_BIT;
|
||||||
#else
|
#else
|
||||||
@@ -760,7 +781,11 @@ static int ug2864ambag01_getrun(fb_coord_t row, fb_coord_t col, FAR uint8_t *buf
|
|||||||
{
|
{
|
||||||
/* Set or clear the corresponding bit */
|
/* Set or clear the corresponding bit */
|
||||||
|
|
||||||
|
#ifdef CONFIG_LCD_RLANDSCAPE
|
||||||
|
uint8_t byte = *fbptr--;
|
||||||
|
#else
|
||||||
uint8_t byte = *fbptr++;
|
uint8_t byte = *fbptr++;
|
||||||
|
#endif
|
||||||
if ((byte & fbmask) != 0)
|
if ((byte & fbmask) != 0)
|
||||||
{
|
{
|
||||||
*buffer |= usrmask;
|
*buffer |= usrmask;
|
||||||
|
|||||||
+43
-23
@@ -100,18 +100,36 @@ if [ ! -d "${configpath}" ]; then
|
|||||||
exit 3
|
exit 3
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -r "${configpath}/Make.defs" ]; then
|
src_makedefs="${configpath}/Make.defs"
|
||||||
echo "File \"${configpath}/Make.defs\" does not exist"
|
dest_makedefs="${TOPDIR}/Make.defs"
|
||||||
|
|
||||||
|
if [ ! -r "${src_makedefs}" ]; then
|
||||||
|
echo "File \"${src_makedefs}\" does not exist"
|
||||||
exit 4
|
exit 4
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -r "${configpath}/setenv.sh" ]; then
|
src_setenv="${configpath}/setenv.sh"
|
||||||
echo "File \"${configpath}/setenv.sh\" does not exist"
|
unset have_setenv
|
||||||
exit 5
|
|
||||||
|
if [ -r "${src_setenv}" ]; then
|
||||||
|
dest_setenv=${TOPDIR}/setenv.sh
|
||||||
|
have_setenv=y
|
||||||
|
else
|
||||||
|
src_setenv="${configpath}/setenv.bat"
|
||||||
|
if [ -r "${src_setenv}" ]; then
|
||||||
|
dest_setenv=${TOPDIR}/setenv.bat
|
||||||
|
have_setenv=y
|
||||||
|
else
|
||||||
|
unset src_setenv
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -r "${configpath}/defconfig" ]; then
|
src_config="${configpath}/defconfig"
|
||||||
echo "File \"${configpath}/defconfig\" does not exist"
|
tmp_config="${TOPDIR}/.configX"
|
||||||
|
dest_config="${TOPDIR}/.config"
|
||||||
|
|
||||||
|
if [ ! -r "${src_config}" ]; then
|
||||||
|
echo "File \"${src_config}\" does not exist"
|
||||||
exit 6
|
exit 6
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -121,11 +139,11 @@ fi
|
|||||||
# (2) The CONFIG_APPS_DIR to see if there is a configured location for the
|
# (2) The CONFIG_APPS_DIR to see if there is a configured location for the
|
||||||
# application directory.
|
# application directory.
|
||||||
|
|
||||||
newconfig=`grep CONFIG_NUTTX_NEWCONFIG= "${configpath}/defconfig" | cut -d'=' -f2`
|
newconfig=`grep CONFIG_NUTTX_NEWCONFIG= "${src_config}" | cut -d'=' -f2`
|
||||||
|
|
||||||
defappdir=y
|
defappdir=y
|
||||||
if [ -z "${appdir}" ]; then
|
if [ -z "${appdir}" ]; then
|
||||||
quoted=`grep "^CONFIG_APPS_DIR=" "${configpath}/defconfig" | cut -d'=' -f2`
|
quoted=`grep "^CONFIG_APPS_DIR=" "${src_config}" | cut -d'=' -f2`
|
||||||
if [ ! -z "${appdir}" ]; then
|
if [ ! -z "${appdir}" ]; then
|
||||||
appdir=`echo ${quoted} | sed -e "s/\"//g"`
|
appdir=`echo ${quoted} | sed -e "s/\"//g"`
|
||||||
defappdir=n
|
defappdir=n
|
||||||
@@ -167,24 +185,26 @@ fi
|
|||||||
|
|
||||||
# Okay... Everything looks good. Setup the configuration
|
# Okay... Everything looks good. Setup the configuration
|
||||||
|
|
||||||
install -C "${configpath}/Make.defs" "${TOPDIR}/." || \
|
install -C "${src_makedefs}" "${dest_makedefs}" || \
|
||||||
{ echo "Failed to copy ${configpath}/Make.defs" ; exit 7 ; }
|
{ echo "Failed to copy \"${src_makedefs}\"" ; exit 7 ; }
|
||||||
install -C "${configpath}/setenv.sh" "${TOPDIR}/." || \
|
if [ "X${have_setenv}" = "Xy" ]; then
|
||||||
{ echo "Failed to copy ${configpath}/setenv.sh" ; exit 8 ; }
|
install -C "${src_setenv}" "${dest_setenv}" || \
|
||||||
chmod 755 "${TOPDIR}/setenv.sh"
|
{ echo "Failed to copy ${src_setenv}" ; exit 8 ; }
|
||||||
install -C "${configpath}/defconfig" "${TOPDIR}/.configX" || \
|
chmod 755 "${dest_setenv}"
|
||||||
{ echo "Failed to copy ${configpath}/defconfig" ; exit 9 ; }
|
fi
|
||||||
|
install -C "${src_config}" "${tmp_config}" || \
|
||||||
|
{ echo "Failed to copy \"${src_config}\"" ; exit 9 ; }
|
||||||
|
|
||||||
# If we did not use the CONFIG_APPS_DIR that was in the defconfig config file,
|
# If we did not use the CONFIG_APPS_DIR that was in the defconfig config file,
|
||||||
# then append the correct application information to the tail of the .config
|
# then append the correct application information to the tail of the .config
|
||||||
# file
|
# file
|
||||||
|
|
||||||
if [ "X${defappdir}" = "Xy" ]; then
|
if [ "X${defappdir}" = "Xy" ]; then
|
||||||
sed -i -e "/^CONFIG_APPS_DIR/d" "${TOPDIR}/.configX"
|
sed -i -e "/^CONFIG_APPS_DIR/d" "${tmp_config}"
|
||||||
echo "" >> "${TOPDIR}/.configX"
|
echo "" >> "${tmp_config}"
|
||||||
echo "# Application configuration" >> "${TOPDIR}/.configX"
|
echo "# Application configuration" >> "${tmp_config}"
|
||||||
echo "" >> "${TOPDIR}/.configX"
|
echo "" >> "${tmp_config}"
|
||||||
echo "CONFIG_APPS_DIR=\"$appdir\"" >> "${TOPDIR}/.configX"
|
echo "CONFIG_APPS_DIR=\"$appdir\"" >> "${tmp_config}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Copy appconfig file. The appconfig file will be copied to ${appdir}/.config
|
# Copy appconfig file. The appconfig file will be copied to ${appdir}/.config
|
||||||
@@ -203,6 +223,6 @@ fi
|
|||||||
# install the final .configX only if it differs from any existing
|
# install the final .configX only if it differs from any existing
|
||||||
# .config file.
|
# .config file.
|
||||||
|
|
||||||
install -C "${TOPDIR}/.configX" "${TOPDIR}/.config"
|
install -C "${tmp_config}" "${dest_config}"
|
||||||
rm -f "${TOPDIR}/.configX"
|
rm -f "${tmp_config}"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user