astyle --formatted --mode=c --indent=spaces=2 --indent-switches --indent-preprocessor --keep-one-line-blocks --max-instatement-indent=60 --brackets=linux --pad-oper --unpad-paren --pad-header
This commit is contained in:
parent
562205cc14
commit
01303fab0d
59 changed files with 3178 additions and 3178 deletions
|
|
@ -7,42 +7,42 @@
|
|||
#define MAX_TARGET_COUNT 1
|
||||
|
||||
void
|
||||
test_register_endianness (void)
|
||||
test_register_endianness(void)
|
||||
{
|
||||
nfc_connstring connstrings[MAX_DEVICE_COUNT];
|
||||
int res = 0;
|
||||
|
||||
nfc_init (NULL);
|
||||
nfc_init(NULL);
|
||||
|
||||
size_t device_count = nfc_list_devices (NULL, connstrings, MAX_DEVICE_COUNT);
|
||||
size_t device_count = nfc_list_devices(NULL, connstrings, MAX_DEVICE_COUNT);
|
||||
if (!device_count)
|
||||
cut_omit ("No NFC device found");
|
||||
cut_omit("No NFC device found");
|
||||
|
||||
nfc_device *device;
|
||||
|
||||
device = nfc_open (NULL, connstrings[0]);
|
||||
cut_assert_not_null (device, cut_message ("nfc_open"));
|
||||
device = nfc_open(NULL, connstrings[0]);
|
||||
cut_assert_not_null(device, cut_message("nfc_open"));
|
||||
|
||||
uint8_t value;
|
||||
|
||||
/* Set a 0xAA test value in writable register memory to test register access */
|
||||
res = pn53x_write_register (device, PN53X_REG_CIU_TxMode, 0xFF, 0xAA);
|
||||
cut_assert_equal_int (0, res, cut_message ("write register value to 0xAA"));
|
||||
res = pn53x_write_register(device, PN53X_REG_CIU_TxMode, 0xFF, 0xAA);
|
||||
cut_assert_equal_int(0, res, cut_message("write register value to 0xAA"));
|
||||
|
||||
/* Get test value from register memory */
|
||||
res = pn53x_read_register (device, PN53X_REG_CIU_TxMode, &value);
|
||||
cut_assert_equal_int (0, res, cut_message ("read register value"));
|
||||
cut_assert_equal_uint (0xAA, value, cut_message ("check register value"));
|
||||
res = pn53x_read_register(device, PN53X_REG_CIU_TxMode, &value);
|
||||
cut_assert_equal_int(0, res, cut_message("read register value"));
|
||||
cut_assert_equal_uint(0xAA, value, cut_message("check register value"));
|
||||
|
||||
/* Set a 0x55 test value in writable register memory to test register access */
|
||||
res = pn53x_write_register (device, PN53X_REG_CIU_TxMode, 0xFF, 0x55);
|
||||
cut_assert_equal_int (0, res, cut_message ("write register value to 0x55"));
|
||||
res = pn53x_write_register(device, PN53X_REG_CIU_TxMode, 0xFF, 0x55);
|
||||
cut_assert_equal_int(0, res, cut_message("write register value to 0x55"));
|
||||
|
||||
/* Get test value from register memory */
|
||||
res = pn53x_read_register (device, PN53X_REG_CIU_TxMode, &value);
|
||||
cut_assert_equal_int (0, res, cut_message ("read register value"));
|
||||
cut_assert_equal_uint (0x55, value, cut_message ("check register value"));
|
||||
res = pn53x_read_register(device, PN53X_REG_CIU_TxMode, &value);
|
||||
cut_assert_equal_int(0, res, cut_message("read register value"));
|
||||
cut_assert_equal_uint(0x55, value, cut_message("check register value"));
|
||||
|
||||
nfc_close (device);
|
||||
nfc_exit (NULL);
|
||||
nfc_close(device);
|
||||
nfc_exit(NULL);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue