From c02397b6390fdb308c52e779e65ab778b7834c32 Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Wed, 15 Dec 2010 10:24:39 +0900 Subject: [PATCH] added PINPAD option to configure --- ChangeLog | 9 +++++++++ src/Makefile.in | 5 +++++ src/config.h.in | 2 ++ src/configure | 45 ++++++++++++++++++++++++++++++++------------- src/gnuk.ld.in | 2 +- 5 files changed, 49 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index d5b211d..ff13c60 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2010-12-15 NIIBE Yutaka + + * 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 * src/configure (FLASH_PAGE_SIZE): Always set. diff --git a/src/Makefile.in b/src/Makefile.in index cdc51a1..6b7fc59 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -1,5 +1,6 @@ # Makefile for Gnuk +@PINPAD_MAKE_OPTION@ @DEBUG_MAKE_OPTION@ ifneq ($(ENABLE_DEBUG),) ENABLE_VCOMPORT=1 @@ -94,6 +95,10 @@ ifneq ($(ENABLE_DEBUG),) CSRC += debug.c endif +ifneq ($(ENABLE_PINPAD),) +CSRC += pin-dial.c +endif + # List ASM source files here ASMSRC = $(PORTASM) \ $(CHIBIOS)/os/ports/GCC/ARMCMx/STM32F10x/vectors.s diff --git a/src/config.h.in b/src/config.h.in index bb5f898..59fa4bf 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -15,3 +15,5 @@ #define SERIAL_NUMBER_IN_AID @SERIAL_NUMBER_FOUR_BYTES@ @DFU_DEFINE@ + +@PINPAD_DEFINE@ diff --git a/src/configure b/src/configure index 8867210..6db83a8 100755 --- a/src/configure +++ b/src/configure @@ -26,6 +26,7 @@ verbose=no with_dfu=default with_fsij=no debug=no +pinpad=no # check /dev/random if test ! -e /dev/random; then @@ -51,6 +52,10 @@ for option; do debug=yes;; --disable-debug) debug=no;; + --enable-pinpad) + pinpad=yes;; + --disable-pinpad) + pinpad=no;; --with-dfu) with_dfu=yes ;; --without-dfu) @@ -82,6 +87,7 @@ Configuration: CQ_STARM STBEE_MINI --enable-debug debug with virtual COM port [no] + --enable-pinpad PIN input device support [no] --with-dfu build image for DFU [] --with-fsij Use FSIJ serial number [no: random number] EOF @@ -96,16 +102,25 @@ else exit 1 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 CQ_STARM|STBEE_MINI) if test "$with_dfu" = "default"; then with_dfu=yes; fi ;; +STM32_PRIMER2) + FLASH_PAGE_SIZE=2048 + ;; +STM8S_DISCOVERY) + FLASH_SIZE=64 + ;; *) - if test "$with_dfu" = "default"; then - with_dfu=no; - fi ;; + ;; esac # --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` fi +# --enable-debug option if test "$debug" = "yes"; then DEBUG_MAKE_OPTION="ENABLE_DEBUG=1" DEBUG_DEFINE="#define DEBUG 1" @@ -133,35 +149,38 @@ else echo "Debug option disabled" fi +# --with-dfu option if test "$with_dfu" = "yes"; then echo "Configured for DFU" ORIGIN=0x08003000 - FLASH_SIZE=116k + FLASH_SIZE=`expr $FLASH_SIZE - 12` DFU_DEFINE="#define DFU_SUPPORT 1" else echo "Configured for bare system (no-DFU)" ORIGIN=0x08000000 - if test "$target" = "STM8S_DISCOVERY"; then - FLASH_SIZE=64k - else - FLASH_SIZE=128k - fi DFU_DEFINE="#undef DFU_SUPPORT" fi -if test "$target" = "STM32_PRIMER2"; then - FLASH_PAGE_SIZE=2048 +# --enable-pinpad option +if test "$pinpad" = "yes"; then + PINPAD_MAKE_OPTION="ENABLE_PINPAD=1" + PINPAD_DEFINE="#define PINPAD_SUPPORT 1" + echo "PIN pad option enabled" else - FLASH_PAGE_SIZE=1024 + PINPAD_MAKE_OPTION="# ENABLE_PINPAD=1" + PINPAD_DEFINE="#undef PINPAD_SUPPORT" + echo "PIN pad option disabled" fi sed -e "s%@BOARD_MAKEFILE@%$BOARD_MAKEFILE%" \ -e "s%@DEBUG_MAKE_OPTION@%$DEBUG_MAKE_OPTION%" \ + -e "s%@PINPAD_MAKE_OPTION@%$PINPAD_MAKE_OPTION%" \ < Makefile.in > Makefile sed -e "s/@ORIGIN@/$ORIGIN/" -e "s/@FLASH_SIZE@/$FLASH_SIZE/" \ -e "s/@FLASH_PAGE_SIZE@/$FLASH_PAGE_SIZE/" \ < gnuk.ld.in > gnuk.ld sed -e "s/@DEBUG_DEFINE@/$DEBUG_DEFINE/" \ + -e "s/@PINPAD_DEFINE@/$PINPAD_DEFINE/" \ -e "s/@DFU_DEFINE@/$DFU_DEFINE/" \ -e "s/@FSIJ_DEFINE@/$FSIJ_DEFINE/" \ -e "s/@SERIAL_NUMBER_FOUR_BYTES@/$SERIAL_NUMBER_FOUR_BYTES/" \ diff --git a/src/gnuk.ld.in b/src/gnuk.ld.in index 8478d32..3bd0aec 100644 --- a/src/gnuk.ld.in +++ b/src/gnuk.ld.in @@ -32,7 +32,7 @@ __stacks_total_size__ = __main_stack_size__; MEMORY { - flash : org = @ORIGIN@, len = @FLASH_SIZE@ + flash : org = @ORIGIN@, len = @FLASH_SIZE@k ram : org = 0x20000000, len = 20k }