added PINPAD option to configure

This commit is contained in:
NIIBE Yutaka
2010-12-15 10:24:39 +09:00
parent 5b6a20aa9d
commit c02397b639
5 changed files with 49 additions and 14 deletions

View File

@@ -1,3 +1,12 @@
2010-12-15 NIIBE Yutaka <gniibe@fsij.org>
* src/configure (FLASH_SIZE): Without 'k'.
* src/gnuk.ld.in (MEMORY): Append "k" here.
* src/config.h.in (@PINPAD_DEFINE@): New.
* src/Makefile.in (@PINPAD_MAKE_OPTION@): New.
* src/configure (PINPAD_MAKE_OPTION, PINPAD_DEFINE): New.
2010-12-14 NIIBE Yutaka <gniibe@fsij.org> 2010-12-14 NIIBE Yutaka <gniibe@fsij.org>
* src/configure (FLASH_PAGE_SIZE): Always set. * src/configure (FLASH_PAGE_SIZE): Always set.

View File

@@ -1,5 +1,6 @@
# Makefile for Gnuk # Makefile for Gnuk
@PINPAD_MAKE_OPTION@
@DEBUG_MAKE_OPTION@ @DEBUG_MAKE_OPTION@
ifneq ($(ENABLE_DEBUG),) ifneq ($(ENABLE_DEBUG),)
ENABLE_VCOMPORT=1 ENABLE_VCOMPORT=1
@@ -94,6 +95,10 @@ ifneq ($(ENABLE_DEBUG),)
CSRC += debug.c CSRC += debug.c
endif endif
ifneq ($(ENABLE_PINPAD),)
CSRC += pin-dial.c
endif
# List ASM source files here # List ASM source files here
ASMSRC = $(PORTASM) \ ASMSRC = $(PORTASM) \
$(CHIBIOS)/os/ports/GCC/ARMCMx/STM32F10x/vectors.s $(CHIBIOS)/os/ports/GCC/ARMCMx/STM32F10x/vectors.s

View File

@@ -15,3 +15,5 @@
#define SERIAL_NUMBER_IN_AID @SERIAL_NUMBER_FOUR_BYTES@ #define SERIAL_NUMBER_IN_AID @SERIAL_NUMBER_FOUR_BYTES@
@DFU_DEFINE@ @DFU_DEFINE@
@PINPAD_DEFINE@

45
src/configure vendored
View File

@@ -26,6 +26,7 @@ verbose=no
with_dfu=default with_dfu=default
with_fsij=no with_fsij=no
debug=no debug=no
pinpad=no
# check /dev/random # check /dev/random
if test ! -e /dev/random; then if test ! -e /dev/random; then
@@ -51,6 +52,10 @@ for option; do
debug=yes;; debug=yes;;
--disable-debug) --disable-debug)
debug=no;; debug=no;;
--enable-pinpad)
pinpad=yes;;
--disable-pinpad)
pinpad=no;;
--with-dfu) --with-dfu)
with_dfu=yes ;; with_dfu=yes ;;
--without-dfu) --without-dfu)
@@ -82,6 +87,7 @@ Configuration:
CQ_STARM CQ_STARM
STBEE_MINI STBEE_MINI
--enable-debug debug with virtual COM port [no] --enable-debug debug with virtual COM port [no]
--enable-pinpad PIN input device support [no]
--with-dfu build image for DFU [<target specific>] --with-dfu build image for DFU [<target specific>]
--with-fsij Use FSIJ serial number [no: random number] --with-fsij Use FSIJ serial number [no: random number]
EOF EOF
@@ -96,16 +102,25 @@ else
exit 1 exit 1
fi fi
# --with-dfu option # Flash page size in byte
FLASH_PAGE_SIZE=1024
# Flash memory size in KB
FLASH_SIZE=128
# Settings for TARGET
case $target in case $target in
CQ_STARM|STBEE_MINI) CQ_STARM|STBEE_MINI)
if test "$with_dfu" = "default"; then if test "$with_dfu" = "default"; then
with_dfu=yes; with_dfu=yes;
fi ;; fi ;;
STM32_PRIMER2)
FLASH_PAGE_SIZE=2048
;;
STM8S_DISCOVERY)
FLASH_SIZE=64
;;
*) *)
if test "$with_dfu" = "default"; then ;;
with_dfu=no;
fi ;;
esac esac
# --with-fsij option # --with-fsij option
@@ -123,6 +138,7 @@ else
SERIAL_NUMBER_FOUR_BYTES=`sed -n -e "/^$MAIL/s/^.* \(..\):\(..\):\(..\):\(..\)/0x\1, 0x\2, 0x\3, 0x\4/p" ../FSIJ_SERIAL_NUMBER` SERIAL_NUMBER_FOUR_BYTES=`sed -n -e "/^$MAIL/s/^.* \(..\):\(..\):\(..\):\(..\)/0x\1, 0x\2, 0x\3, 0x\4/p" ../FSIJ_SERIAL_NUMBER`
fi fi
# --enable-debug option
if test "$debug" = "yes"; then if test "$debug" = "yes"; then
DEBUG_MAKE_OPTION="ENABLE_DEBUG=1" DEBUG_MAKE_OPTION="ENABLE_DEBUG=1"
DEBUG_DEFINE="#define DEBUG 1" DEBUG_DEFINE="#define DEBUG 1"
@@ -133,35 +149,38 @@ else
echo "Debug option disabled" echo "Debug option disabled"
fi fi
# --with-dfu option
if test "$with_dfu" = "yes"; then if test "$with_dfu" = "yes"; then
echo "Configured for DFU" echo "Configured for DFU"
ORIGIN=0x08003000 ORIGIN=0x08003000
FLASH_SIZE=116k FLASH_SIZE=`expr $FLASH_SIZE - 12`
DFU_DEFINE="#define DFU_SUPPORT 1" DFU_DEFINE="#define DFU_SUPPORT 1"
else else
echo "Configured for bare system (no-DFU)" echo "Configured for bare system (no-DFU)"
ORIGIN=0x08000000 ORIGIN=0x08000000
if test "$target" = "STM8S_DISCOVERY"; then
FLASH_SIZE=64k
else
FLASH_SIZE=128k
fi
DFU_DEFINE="#undef DFU_SUPPORT" DFU_DEFINE="#undef DFU_SUPPORT"
fi fi
if test "$target" = "STM32_PRIMER2"; then # --enable-pinpad option
FLASH_PAGE_SIZE=2048 if test "$pinpad" = "yes"; then
PINPAD_MAKE_OPTION="ENABLE_PINPAD=1"
PINPAD_DEFINE="#define PINPAD_SUPPORT 1"
echo "PIN pad option enabled"
else else
FLASH_PAGE_SIZE=1024 PINPAD_MAKE_OPTION="# ENABLE_PINPAD=1"
PINPAD_DEFINE="#undef PINPAD_SUPPORT"
echo "PIN pad option disabled"
fi fi
sed -e "s%@BOARD_MAKEFILE@%$BOARD_MAKEFILE%" \ sed -e "s%@BOARD_MAKEFILE@%$BOARD_MAKEFILE%" \
-e "s%@DEBUG_MAKE_OPTION@%$DEBUG_MAKE_OPTION%" \ -e "s%@DEBUG_MAKE_OPTION@%$DEBUG_MAKE_OPTION%" \
-e "s%@PINPAD_MAKE_OPTION@%$PINPAD_MAKE_OPTION%" \
< Makefile.in > Makefile < Makefile.in > Makefile
sed -e "s/@ORIGIN@/$ORIGIN/" -e "s/@FLASH_SIZE@/$FLASH_SIZE/" \ sed -e "s/@ORIGIN@/$ORIGIN/" -e "s/@FLASH_SIZE@/$FLASH_SIZE/" \
-e "s/@FLASH_PAGE_SIZE@/$FLASH_PAGE_SIZE/" \ -e "s/@FLASH_PAGE_SIZE@/$FLASH_PAGE_SIZE/" \
< gnuk.ld.in > gnuk.ld < gnuk.ld.in > gnuk.ld
sed -e "s/@DEBUG_DEFINE@/$DEBUG_DEFINE/" \ sed -e "s/@DEBUG_DEFINE@/$DEBUG_DEFINE/" \
-e "s/@PINPAD_DEFINE@/$PINPAD_DEFINE/" \
-e "s/@DFU_DEFINE@/$DFU_DEFINE/" \ -e "s/@DFU_DEFINE@/$DFU_DEFINE/" \
-e "s/@FSIJ_DEFINE@/$FSIJ_DEFINE/" \ -e "s/@FSIJ_DEFINE@/$FSIJ_DEFINE/" \
-e "s/@SERIAL_NUMBER_FOUR_BYTES@/$SERIAL_NUMBER_FOUR_BYTES/" \ -e "s/@SERIAL_NUMBER_FOUR_BYTES@/$SERIAL_NUMBER_FOUR_BYTES/" \

View File

@@ -32,7 +32,7 @@ __stacks_total_size__ = __main_stack_size__;
MEMORY MEMORY
{ {
flash : org = @ORIGIN@, len = @FLASH_SIZE@ flash : org = @ORIGIN@, len = @FLASH_SIZE@k
ram : org = 0x20000000, len = 20k ram : org = 0x20000000, len = 20k
} }