Fix current code to compile under Windows. Thanks to Fkooman

This commit is contained in:
Romuald Conty 2009-09-04 08:32:32 +00:00
parent 759db4d7a7
commit 4457a3e327
2 changed files with 12 additions and 3 deletions

View file

@ -137,10 +137,18 @@ bool dev_arygon_transceive(const dev_spec ds, const byte_t* pbtTx, const uint32_
}
/** @note ARYGON-APDB need 20ms between sending and receiving frame. No information regarding this in ARYGON datasheet... */
usleep(20000);
#ifdef _WIN32
Sleep(20);
#else
usleep(20000);
#endif
/** @note ARYGON-APDB need 20ms more to be able to report (correctly) present tag. */
usleep(20000);
#ifdef _WIN32
Sleep(20);
#else
usleep(20000);
#endif
if (!rs232_receive((serial_port)ds,abtRxBuf,&uiRxBufLen)) {
ERR("Unable to receive data. (RX)");

View file

@ -389,12 +389,13 @@ bool nfc_initiator_init(const dev_info* pdi)
bool nfc_initiator_select_dep_target(const dev_info* pdi, const init_modulation im, const byte_t* pbtPidData, const uint32_t uiPidDataLen, const byte_t* pbtNFCID3i, const uint32_t uiNFCID3iDataLen, const byte_t *pbtGbData, const uint32_t uiGbDataLen, tag_info* pti)
{
uint32_t offset;
if(im == IM_ACTIVE_DEP) {
pncmd_reader_jump_for_dep[2] = 0x01; /* active DEP */
}
pncmd_reader_jump_for_dep[3] = 0x00; /* baud rate = 106kbps */
uint32_t offset = 5;
offset = 5;
if(pbtPidData && im != IM_ACTIVE_DEP) { /* can't have passive initiator data when using active mode */
pncmd_reader_jump_for_dep[4] |= 0x01;
memcpy(pncmd_reader_jump_for_dep+offset,pbtPidData,uiPidDataLen);