修改反馈的格式问题

This commit is contained in:
WUSY1991 2021-09-20 09:20:17 +08:00
parent 05bf7e61f6
commit 2389b309f4
9 changed files with 122 additions and 15061 deletions

View File

@ -3,23 +3,7 @@
# If you need to exclude a file, add the path to the file in file_path.
file_path:
- Libraries/core/board_config.h
- Libraries/core/misc.c
- Libraries/core/misc.h
- Libraries/core/rom_api.h
- Libraries/core/system.c
- Libraries/core/system.h
- Libraries/core/type.h
- Libraries/core/yc3121.h
- Libraries/sdk/yc_dma.c
- Libraries/sdk/yc_dma.h
- Libraries/sdk/yc_gpio.c
- Libraries/sdk/yc_gpio.h
- Libraries/sdk/yc_systick.c
- Libraries/sdk/yc_uart.c
- Libraries/sdk/yc_uart.h
dir_path:
- Libraries/core
- Libraries/sdk
- Libraries/startup
- Libraries

View File

@ -31,6 +31,12 @@ YC3121-pos 开发板板载资源如下:
- UART
- SPI LCD
- SPI NFC
- 7816
- 7811
- 调试接口SWD
- 7816接口 接触IC卡支持3V , 1.8V
- 7811接口 三轨磁条卡解码模块支持ISO/ABA AAMVA 及IBM等标准卡
- TIMER9个32bi位 支持PWM
- TRNG1个真随机数发生器
- 安全加密算法
- 对称算法对称算法DES、TDES、AES-128/192/256、国密IVSM4
- 非对称算法RSA-1024/2048、国密IISM2、ECC
- HASH 校验算法SHA-1/224/256/384/512、国密IIISM3
- 调试接口SWD / ICE

View File

@ -13,6 +13,8 @@
#include <board.h>
#include <rthw.h>
#define PIN_MAX_NUM (48)
typedef void (*pin_callback_t)(void *args);
struct pin
{
@ -25,6 +27,59 @@ struct pin
};
typedef struct pin pin_t;
struct rt_pin_irq_hdr pin_irq_hdr_tab[] =
{
{-1, 0, RT_NULL, RT_NULL},
{-1, 0, RT_NULL, RT_NULL},
{-1, 0, RT_NULL, RT_NULL},
{-1, 0, RT_NULL, RT_NULL},
{-1, 0, RT_NULL, RT_NULL},
{-1, 0, RT_NULL, RT_NULL},
{-1, 0, RT_NULL, RT_NULL},
{-1, 0, RT_NULL, RT_NULL},
{-1, 0, RT_NULL, RT_NULL},
{-1, 0, RT_NULL, RT_NULL},
{-1, 0, RT_NULL, RT_NULL},
{-1, 0, RT_NULL, RT_NULL},
{-1, 0, RT_NULL, RT_NULL},
{-1, 0, RT_NULL, RT_NULL},
{-1, 0, RT_NULL, RT_NULL},
{-1, 0, RT_NULL, RT_NULL},
{-1, 0, RT_NULL, RT_NULL},
{-1, 0, RT_NULL, RT_NULL},
{-1, 0, RT_NULL, RT_NULL},
{-1, 0, RT_NULL, RT_NULL},
{-1, 0, RT_NULL, RT_NULL},
{-1, 0, RT_NULL, RT_NULL},
{-1, 0, RT_NULL, RT_NULL},
{-1, 0, RT_NULL, RT_NULL},
{-1, 0, RT_NULL, RT_NULL},
{-1, 0, RT_NULL, RT_NULL},
{-1, 0, RT_NULL, RT_NULL},
{-1, 0, RT_NULL, RT_NULL},
{-1, 0, RT_NULL, RT_NULL},
{-1, 0, RT_NULL, RT_NULL},
{-1, 0, RT_NULL, RT_NULL},
{-1, 0, RT_NULL, RT_NULL},
{-1, 0, RT_NULL, RT_NULL},
{-1, 0, RT_NULL, RT_NULL},
{-1, 0, RT_NULL, RT_NULL},
{-1, 0, RT_NULL, RT_NULL},
{-1, 0, RT_NULL, RT_NULL},
{-1, 0, RT_NULL, RT_NULL},
{-1, 0, RT_NULL, RT_NULL},
{-1, 0, RT_NULL, RT_NULL},
{-1, 0, RT_NULL, RT_NULL},
{-1, 0, RT_NULL, RT_NULL},
{-1, 0, RT_NULL, RT_NULL},
{-1, 0, RT_NULL, RT_NULL},
{-1, 0, RT_NULL, RT_NULL},
{-1, 0, RT_NULL, RT_NULL},
{-1, 0, RT_NULL, RT_NULL},
{-1, 0, RT_NULL, RT_NULL},
};
static void yc_pin_mode(rt_device_t dev, rt_base_t pin, rt_base_t mode)
{
/* Configure GPIO_InitStructure */
@ -78,33 +133,42 @@ static rt_err_t yc_pin_attach_irq(struct rt_device *device,
pin_callback_t cb,
void *args)
{
pin_t *index;
rt_int32_t index = -1;
rt_base_t level;
if (index == RT_NULL)
if (pin >= PIN_MAX_NUM)
{
return RT_EINVAL;
return -RT_EINVAL;
}
level = rt_hw_interrupt_disable();
index->callback = cb;
index->callback_args = args;
index->irq_mode = mode;
index = pin;
level = rt_hw_interrupt_disable();
pin_irq_hdr_tab[index].pin = pin;
pin_irq_hdr_tab[index].hdr = cb;
pin_irq_hdr_tab[index].mode = mode;
pin_irq_hdr_tab[index].args = args;
rt_hw_interrupt_enable(level);
return RT_EOK;
}
static rt_err_t yc_pin_detach_irq(struct rt_device *device, rt_int32_t pin)
{
pin_t *index;
rt_int32_t index = -1;
rt_base_t level;
if (index == RT_NULL)
if (pin >= PIN_MAX_NUM)
{
return RT_EINVAL;
return -RT_EINVAL;
}
index = pin;
level = rt_hw_interrupt_disable();
index->callback = 0;
index->callback_args = 0;
index->irq_mode = 0;
pin_irq_hdr_tab[index].pin = -1;
pin_irq_hdr_tab[index].hdr = RT_NULL;
pin_irq_hdr_tab[index].mode = 0;
pin_irq_hdr_tab[index].args = RT_NULL;
rt_hw_interrupt_enable(level);
return RT_EOK;
}
@ -113,15 +177,18 @@ static rt_err_t yc_pin_irq_enable(struct rt_device *device,
rt_base_t pin,
rt_uint32_t enabled)
{
pin_t *index;
rt_int32_t index;
rt_base_t level = 0;
if (index == RT_NULL)
if (pin >= PIN_MAX_NUM)
{
return RT_EINVAL;
return -RT_EINVAL;
}
index = pin;
if (enabled == PIN_IRQ_ENABLE)
{
switch (index->irq_mode)
switch (pin_irq_hdr_tab[index].mode)
{
case PIN_IRQ_MODE_RISING:
@ -134,11 +201,11 @@ static rt_err_t yc_pin_irq_enable(struct rt_device *device,
break;
case PIN_IRQ_MODE_HIGH_LEVEL:
GPIO_CONFIG(pin) = PULL_DOWN;
GPIO_TRIG_MODE(pin/16) &= (1 << (pin % 16));
GPIO_TRIG_MODE(pin / 16) &= (1 << (pin % 16));
break;
case PIN_IRQ_MODE_LOW_LEVEL:
GPIO_CONFIG(pin) = PULL_UP;
GPIO_TRIG_MODE(pin/16) |= (1 << (pin % 16));
GPIO_TRIG_MODE(pin / 16) |= (1 << (pin % 16));
break;
default:
rt_hw_interrupt_enable(level);
@ -146,13 +213,13 @@ static rt_err_t yc_pin_irq_enable(struct rt_device *device,
}
level = rt_hw_interrupt_disable();
NVIC_EnableIRQ(index->irq);
NVIC_EnableIRQ(GPIO_IRQn);
GPIO_INTR_EN(pin / 16) |= (1 << (pin % 16));
rt_hw_interrupt_enable(level);
}
else if (enabled == PIN_IRQ_DISABLE)
{
NVIC_DisableIRQ(index->irq);
NVIC_DisableIRQ(GPIO_IRQn);
GPIO_INTR_EN(pin / 16) &= ~(1 << (pin % 16));
}
else
@ -163,14 +230,14 @@ static rt_err_t yc_pin_irq_enable(struct rt_device *device,
}
const static struct rt_pin_ops yc3121_pin_ops =
{
yc_pin_mode,
yc_pin_write,
yc_pin_read,
yc_pin_attach_irq,
yc_pin_detach_irq,
yc_pin_irq_enable,
RT_NULL,
{
yc_pin_mode,
yc_pin_write,
yc_pin_read,
yc_pin_attach_irq,
yc_pin_detach_irq,
yc_pin_irq_enable,
RT_NULL,
};
int rt_hw_pin_init(void)
@ -181,19 +248,20 @@ int rt_hw_pin_init(void)
}
INIT_BOARD_EXPORT(rt_hw_pin_init);
void GPIOA_Handler(void)
void GPIO_IRQHandler(void)
{
int i;
/* enter interrupt */
rt_interrupt_enter();
for (i = 0; i < 48; i++)
for (i = 0; i < PIN_MAX_NUM; i++)
{
// if(GPIO_IN(pin / 16) & (1 << (pin % 16)))
if ((GPIO_TRIG_MODE(i / 16) & (1 << (i % 16))) == (GPIO_IN(i / 16) & (1 << (i % 16))))
{
if (pin_irq_hdr_tab[i].hdr)
{
pin_irq_hdr_tab[i].hdr(pin_irq_hdr_tab[i].args);
}
}
}
/* leave interrupt */
rt_interrupt_leave();
}

View File

@ -191,4 +191,3 @@ int rt_hw_uart_init(void)
#endif /* BSP_USING_UART1 */
return 0;
}
INIT_BOARD_EXPORT(rt_hw_uart_init);

View File

@ -176,7 +176,7 @@
<Group>
<GroupName>Applications</GroupName>
<tvExp>1</tvExp>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
@ -380,7 +380,7 @@
<Group>
<GroupName>Drivers</GroupName>
<tvExp>1</tvExp>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
@ -424,7 +424,7 @@
<Group>
<GroupName>Finsh</GroupName>
<tvExp>1</tvExp>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
@ -664,7 +664,7 @@
<Group>
<GroupName>Libraries</GroupName>
<tvExp>1</tvExp>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
@ -776,18 +776,6 @@
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>8</GroupNumber>
<FileNumber>46</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>Libraries\core\bt_code_boot.c</PathWithFileName>
<FilenameWithoutPath>bt_code_boot.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
</Group>
</ProjectOpt>

View File

@ -641,11 +641,6 @@
<FileType>1</FileType>
<FilePath>Libraries\sdk\yc_systick.c</FilePath>
</File>
<File>
<FileName>bt_code_boot.c</FileName>
<FileType>1</FileType>
<FilePath>Libraries\core\bt_code_boot.c</FilePath>
</File>
</Files>
</Group>
</Groups>

File diff suppressed because it is too large Load Diff