pinpad support (4)
This commit is contained in:
@@ -96,7 +96,7 @@ CSRC += debug.c
|
||||
endif
|
||||
|
||||
ifneq ($(ENABLE_PINPAD),)
|
||||
CSRC += pin-dial.c
|
||||
CSRC += pin-$(ENABLE_PINPAD).c
|
||||
endif
|
||||
|
||||
# List ASM source files here
|
||||
|
||||
@@ -17,3 +17,4 @@
|
||||
@DFU_DEFINE@
|
||||
|
||||
@PINPAD_DEFINE@
|
||||
@PINPAD_MORE_DEFINE@
|
||||
|
||||
27
src/configure
vendored
27
src/configure
vendored
@@ -1,4 +1,4 @@
|
||||
#! /bin/sh
|
||||
#! /bin/bash
|
||||
|
||||
#
|
||||
# This file is *NOT* generated by GNU Autoconf, but written by NIIBE Yutaka
|
||||
@@ -54,6 +54,8 @@ for option; do
|
||||
debug=no ;;
|
||||
--enable-pinpad)
|
||||
pinpad=yes ;;
|
||||
--enable-pinpad=*)
|
||||
pinpad=$optarg ;;
|
||||
--disable-pinpad)
|
||||
pinpad=no ;;
|
||||
--with-dfu)
|
||||
@@ -87,7 +89,8 @@ Configuration:
|
||||
CQ_STARM
|
||||
STBEE_MINI
|
||||
--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-fsij Use FSIJ serial number [no: random number]
|
||||
EOF
|
||||
@@ -162,14 +165,21 @@ else
|
||||
fi
|
||||
|
||||
# --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
|
||||
PINPAD_MAKE_OPTION="# ENABLE_PINPAD=1"
|
||||
if test "$pinpad" = "no"; then
|
||||
PINPAD_MAKE_OPTION="# ENABLE_PINPAD="
|
||||
PINPAD_DEFINE="#undef PINPAD_SUPPORT"
|
||||
PINPAD_MORE_DEFINE=""
|
||||
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
|
||||
|
||||
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
|
||||
sed -e "s/@DEBUG_DEFINE@/$DEBUG_DEFINE/" \
|
||||
-e "s/@PINPAD_DEFINE@/$PINPAD_DEFINE/" \
|
||||
-e "s/@PINPAD_MORE_DEFINE@/$PINPAD_MORE_DEFINE/" \
|
||||
-e "s/@DFU_DEFINE@/$DFU_DEFINE/" \
|
||||
-e "s/@FSIJ_DEFINE@/$FSIJ_DEFINE/" \
|
||||
-e "s/@SERIAL_NUMBER_FOUR_BYTES@/$SERIAL_NUMBER_FOUR_BYTES/" \
|
||||
|
||||
@@ -175,8 +175,8 @@ static uint8_t cir_proto;
|
||||
#define CIR_PROTO_NEC 5
|
||||
#define CIR_PROTO_SHARP 6
|
||||
|
||||
#define CIR_KEY_RC6_ENTER 0x5c
|
||||
#define CIR_KEY_RC6_BACKSPACE 0xa4
|
||||
#define CIR_KEY_RC6_ENTER 0x0d /* Mute */
|
||||
#define CIR_KEY_RC6_BACKSPACE 0xa4 /* <= */
|
||||
#define CIR_KEY_NEC_ENTER 0x3d /* 'kettei' */
|
||||
#define CIR_KEY_NEC_BACKSPACE 0x3b /* 'modoru' */
|
||||
#define CIR_KEY_SONY_ENTER 0x65 /* 'kettei' */
|
||||
@@ -273,7 +273,9 @@ pin_main (void *arg)
|
||||
DEBUG_INFO ("**** CIR data:");
|
||||
DEBUG_WORD (cir_data);
|
||||
if (cir_seq > 48)
|
||||
{
|
||||
DEBUG_SHORT (cir_data_more);
|
||||
}
|
||||
DEBUG_BYTE (cir_seq);
|
||||
|
||||
if (cir_key_is_backspace ())
|
||||
@@ -553,14 +555,14 @@ cir_timer_interrupt (void)
|
||||
else if (cir_seq == 1 + 48)
|
||||
{
|
||||
if ((cir_data >> 28) ==
|
||||
((cir_data_more >> 12) & 0x0f)
|
||||
(((cir_data_more >> 12) & 0x0f)
|
||||
^ ((cir_data_more >> 8) & 0x0f)
|
||||
^ ((cir_data_more >> 4) & 0x0f)
|
||||
^ (cir_data_more & 0x0f)
|
||||
^ ((cir_data >> 24) & 0x0f)
|
||||
^ ((cir_data >> 20) & 0x0f) ^ ((cir_data >> 16) & 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_data = (cir_data >> 16) & 0x0fff;
|
||||
|
||||
Reference in New Issue
Block a user