pinpad support (4)

This commit is contained in:
NIIBE Yutaka
2011-01-06 17:27:14 +09:00
parent 03393c5247
commit 57859fb417
4 changed files with 43 additions and 29 deletions

View File

@@ -96,7 +96,7 @@ CSRC += debug.c
endif endif
ifneq ($(ENABLE_PINPAD),) ifneq ($(ENABLE_PINPAD),)
CSRC += pin-dial.c CSRC += pin-$(ENABLE_PINPAD).c
endif endif
# List ASM source files here # List ASM source files here

View File

@@ -17,3 +17,4 @@
@DFU_DEFINE@ @DFU_DEFINE@
@PINPAD_DEFINE@ @PINPAD_DEFINE@
@PINPAD_MORE_DEFINE@

35
src/configure vendored
View File

@@ -1,4 +1,4 @@
#! /bin/sh #! /bin/bash
# #
# This file is *NOT* generated by GNU Autoconf, but written by NIIBE Yutaka # This file is *NOT* generated by GNU Autoconf, but written by NIIBE Yutaka
@@ -49,13 +49,15 @@ for option; do
-v | --verbose) -v | --verbose)
verbose=yes ;; verbose=yes ;;
--enable-debug) --enable-debug)
debug=yes;; debug=yes ;;
--disable-debug) --disable-debug)
debug=no;; debug=no ;;
--enable-pinpad) --enable-pinpad)
pinpad=yes;; pinpad=yes ;;
--enable-pinpad=*)
pinpad=$optarg ;;
--disable-pinpad) --disable-pinpad)
pinpad=no;; pinpad=no ;;
--with-dfu) --with-dfu)
with_dfu=yes ;; with_dfu=yes ;;
--without-dfu) --without-dfu)
@@ -87,7 +89,8 @@ 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] --enable-pinpad={cir,dial}
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
@@ -162,14 +165,21 @@ else
fi fi
# --enable-pinpad option # --enable-pinpad option
if test "$pinpad" = "yes"; then if test "$pinpad" = "no"; then
PINPAD_MAKE_OPTION="ENABLE_PINPAD=1" PINPAD_MAKE_OPTION="# ENABLE_PINPAD="
PINPAD_DEFINE="#define PINPAD_SUPPORT 1"
echo "PIN pad option enabled"
else
PINPAD_MAKE_OPTION="# ENABLE_PINPAD=1"
PINPAD_DEFINE="#undef PINPAD_SUPPORT" PINPAD_DEFINE="#undef PINPAD_SUPPORT"
PINPAD_MORE_DEFINE=""
echo "PIN pad option disabled" echo "PIN pad option disabled"
elif test "$pinpad" = "yes"; then
PINPAD_MAKE_OPTION="ENABLE_PINPAD=cir"
PINPAD_DEFINE="#define PINPAD_SUPPORT 1"
PINPAD_MORE_DEFINE="#define PINPAD_CIR_SUPPORT 1"
echo "PIN pad option enabled (cir)"
else
PINPAD_MAKE_OPTION="ENABLE_PINPAD=$pinpad"
PINPAD_DEFINE="#define PINPAD_SUPPORT 1"
PINPAD_MORE_DEFINE="#define PINPAD_${pinpad^^[a-z]}_SUPPORT 1"
echo "PIN pad option enabled ($pinpad)"
fi fi
sed -e "s%@BOARD_MAKEFILE@%$BOARD_MAKEFILE%" \ sed -e "s%@BOARD_MAKEFILE@%$BOARD_MAKEFILE%" \
@@ -181,6 +191,7 @@ sed -e "s/@ORIGIN@/$ORIGIN/" -e "s/@FLASH_SIZE@/$FLASH_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/@PINPAD_DEFINE@/$PINPAD_DEFINE/" \
-e "s/@PINPAD_MORE_DEFINE@/$PINPAD_MORE_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

@@ -175,14 +175,14 @@ static uint8_t cir_proto;
#define CIR_PROTO_NEC 5 #define CIR_PROTO_NEC 5
#define CIR_PROTO_SHARP 6 #define CIR_PROTO_SHARP 6
#define CIR_KEY_RC6_ENTER 0x5c #define CIR_KEY_RC6_ENTER 0x0d /* Mute */
#define CIR_KEY_RC6_BACKSPACE 0xa4 #define CIR_KEY_RC6_BACKSPACE 0xa4 /* <= */
#define CIR_KEY_NEC_ENTER 0x3d /* 'kettei' */ #define CIR_KEY_NEC_ENTER 0x3d /* 'kettei' */
#define CIR_KEY_NEC_BACKSPACE 0x3b /* 'modoru' */ #define CIR_KEY_NEC_BACKSPACE 0x3b /* 'modoru' */
#define CIR_KEY_SONY_ENTER 0x65 /* 'kettei' */ #define CIR_KEY_SONY_ENTER 0x65 /* 'kettei' */
#define CIR_KEY_SONY_BACKSPACE 0xa3 /* 'modoru' */ #define CIR_KEY_SONY_BACKSPACE 0xa3 /* 'modoru' */
#define CIR_KEY_SHARP_ENTER 0x0252 /* 'kettei' */ #define CIR_KEY_SHARP_ENTER 0x0252 /* 'kettei' */
#define CIR_KEY_SHARP_BACKSPACE 0xe4 /* 'modoru' */ #define CIR_KEY_SHARP_BACKSPACE 0xe4 /* 'modoru' */
/* CIR_DATA_ZERO: Used for zero-bit handling of RC-5/RC-6 */ /* CIR_DATA_ZERO: Used for zero-bit handling of RC-5/RC-6 */
static uint8_t cir_data_zero; static uint8_t cir_data_zero;
@@ -273,7 +273,9 @@ pin_main (void *arg)
DEBUG_INFO ("**** CIR data:"); DEBUG_INFO ("**** CIR data:");
DEBUG_WORD (cir_data); DEBUG_WORD (cir_data);
if (cir_seq > 48) if (cir_seq > 48)
DEBUG_SHORT (cir_data_more); {
DEBUG_SHORT (cir_data_more);
}
DEBUG_BYTE (cir_seq); DEBUG_BYTE (cir_seq);
if (cir_key_is_backspace ()) if (cir_key_is_backspace ())
@@ -553,14 +555,14 @@ cir_timer_interrupt (void)
else if (cir_seq == 1 + 48) else if (cir_seq == 1 + 48)
{ {
if ((cir_data >> 28) == if ((cir_data >> 28) ==
((cir_data_more >> 12) & 0x0f) (((cir_data_more >> 12) & 0x0f)
^ ((cir_data_more >> 8) & 0x0f) ^ ((cir_data_more >> 8) & 0x0f)
^ ((cir_data_more >> 4) & 0x0f) ^ ((cir_data_more >> 4) & 0x0f)
^ (cir_data_more & 0x0f) ^ (cir_data_more & 0x0f)
^ ((cir_data >> 24) & 0x0f) ^ ((cir_data >> 24) & 0x0f)
^ ((cir_data >> 20) & 0x0f) ^ ((cir_data >> 16) & 0x0f) ^ ((cir_data >> 20) & 0x0f) ^ ((cir_data >> 16) & 0x0f)
^ ((cir_data >> 12) & 0x0f) ^ ((cir_data >> 8) & 0x0f) ^ ((cir_data >> 12) & 0x0f) ^ ((cir_data >> 8) & 0x0f)
^ ((cir_data >> 4) & 0x0f) ^ (cir_data & 0x0f)) ^ ((cir_data >> 4) & 0x0f) ^ (cir_data & 0x0f)))
{ {
cir_proto = CIR_PROTO_SHARP; cir_proto = CIR_PROTO_SHARP;
cir_data = (cir_data >> 16) & 0x0fff; cir_data = (cir_data >> 16) & 0x0fff;