在main.c文件中定义Money_Decrement()函数,实现向第4数据块卡中扣款100元并输出扣款结果
// 减数据函数
void Money_Decrement(void)
{
int8_t status = 0;
status = RFID_DECREMENT(0x04, Card_DefaultKey, 100);
if(status == MI_OK)
{
printf("Decrement successfully!!\r\n");
RFID_Read(4, Card_DefaultKey, Read_Data);
money = *(int32_t*)Read_Data;
printf("Money count: %d\r\n", money);
}
else
{
printf("Decrement failed, ");
Error_Display(status);
}
}
|