mirror of
https://github.com/whowechina/aic_pico.git
synced 2024-11-13 17:30:52 +01:00
Correct pn532 select/deselect
This commit is contained in:
parent
12d1372c76
commit
0f6844f47c
@ -71,7 +71,7 @@ struct {
|
||||
pn532_felica_read,
|
||||
pn532_set_wait_loop,
|
||||
pn532_select,
|
||||
NULL,
|
||||
pn532_deselect,
|
||||
},
|
||||
{
|
||||
pn5180_firmware_ver,
|
||||
|
@ -470,7 +470,18 @@ bool pn532_felica_write(uint16_t svc_code, uint16_t block_id, const uint8_t bloc
|
||||
|
||||
void pn532_select()
|
||||
{
|
||||
uint8_t ignore_buf[7];
|
||||
int ignore_len;
|
||||
pn532_poll_mifare(ignore_buf, &ignore_len);
|
||||
uint8_t param[] = {0x01};
|
||||
pn532_write_command(0x54, param, sizeof(param));
|
||||
|
||||
uint8_t ignored;
|
||||
pn532_read_response(0x54, &ignored, 1);
|
||||
}
|
||||
|
||||
void pn532_deselect()
|
||||
{
|
||||
uint8_t param[] = {0x01};
|
||||
pn532_write_command(0x44, param, sizeof(param));
|
||||
|
||||
uint8_t ignored;
|
||||
pn532_read_response(0x44, &ignored, 1);
|
||||
}
|
||||
|
@ -36,5 +36,6 @@ bool pn532_felica_read(uint16_t svc_code, uint16_t block_id, uint8_t block_data[
|
||||
bool pn532_felica_write(uint16_t svc_code, uint16_t block_id, const uint8_t block_data[16]);
|
||||
|
||||
void pn532_select();
|
||||
void pn532_deselect();
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user