astyle --formatted --mode=c --indent=spaces=2 --indent-switches --indent-preprocessor --keep-one-line-blocks --max-instatement-indent=60
This commit is contained in:
parent
26569c2202
commit
a2cd236441
45 changed files with 1096 additions and 1082 deletions
|
|
@ -9,40 +9,40 @@
|
|||
void
|
||||
test_register_endianness (void)
|
||||
{
|
||||
nfc_connstring connstrings[MAX_DEVICE_COUNT];
|
||||
int res = 0;
|
||||
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);
|
||||
if (!device_count)
|
||||
cut_omit ("No NFC device found");
|
||||
size_t device_count = nfc_list_devices (NULL, connstrings, MAX_DEVICE_COUNT);
|
||||
if (!device_count)
|
||||
cut_omit ("No NFC device found");
|
||||
|
||||
nfc_device *device;
|
||||
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;
|
||||
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"));
|
||||
/* 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"));
|
||||
|
||||
/* 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"));
|
||||
/* 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"));
|
||||
|
||||
/* 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"));
|
||||
/* 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"));
|
||||
|
||||
/* 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"));
|
||||
/* 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"));
|
||||
|
||||
nfc_close (device);
|
||||
nfc_exit (NULL);
|
||||
nfc_close (device);
|
||||
nfc_exit (NULL);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue