2014-04-27 3 views
0

모듈에서 이전 작업 코드를 분리하려고했지만 항상이 오류가 발생합니다. 코드에 어떤 문제가 있는지 확인 void read_card(boolean *success,uint8_t *uid,uint8_t *uidLength);Arduino가 '*'토큰 앞에 '' '토큰을 사용했습니다.

하지 ... 내 헤더 nfc_read.h에서

: 어쩌면 여기

#ifndef _nfc_read_h_ 
    #define _nfc_read_h_ 

//Libarys 
#include <Wire.h> 
#include <Adafruit_NFCShield_I2C.h> 


void setup_adafruit(int mode); 
void read_card(boolean *success,uint8_t *uid,uint8_t *uidLength);//<--here is the error 

#endif 

"nfc_read.h:24: error: expected ')' before '*' token" 

라인 (24)입니다 어딘가에서 실수 :

#include "nfc_read.h" 

#define IRQ (2) // IRQ = Interrupt request uint8 (input) 
#define RESET (3) // Not connected by default on the NFC Shield uint8 (output) 

void setup_adafruit(int mode) 
{ 
    Adafruit_NFCShield_I2C nfc(IRQ, RESET); //Funktionspointer....Pins konfigurieren IRQ => input ,RESET => output 

    Serial.println("Welcome this application will read your UID of your ISO14443A-Card"); //Willkommens Text 

    nfc.begin(); 

    uint32_t versiondata = nfc.getFirmwareVersion(); 

    if (! versiondata) { 
    Serial.print("Didn't find Arduino board"); 
    while (1); // halt 
    } 

    nfc.setPassiveActivationRetries(0xFF); 

    // configure board to read RFID tags 
    nfc.SAMConfig(); 

    Serial.println("Waiting for an ISO14443A card"); 
} 

void read_card(boolean *success,uint8_t *uid,uint8_t *uidLength) 
{ 
    *success = nfc.readPassiveTargetID(PN532_MIFARE_ISO14443A, &uid[0], &uidLength); 
} 
+0

(버그가 아님) ::'#define _nfc_read_h_' :: 밑줄로 시작하는 식별자를 사용하지 마십시오. 그들은 예약되어 있습니다. – wildplasser

+1

귀하의 지시에 따라 어떤 라인 (# 24)이 오류의 원인인지 명확히 할 수 있습니까? –

+0

@wildplasser 정의를 제거하더라도 아무 것도 변경되지 않습니다 ... – Samy

답변

1

아마도 도움이 될까요?

#ifndef _nfc_read_h_ 
    #define _nfc_read_h_ 

//Libarys 
#include <Wire.h> 
#include <Adafruit_NFCShield_I2C.h> 

다음과 같은 줄을 추가

#include <stdint.h> 
#ifndef boolean 
    #define boolean int 
#endif 

위의 라인은 적절한 유형이 정의되어 있는지 확인합니다.

void setup_adafruit(int mode); 
void read_card(boolean *success,uint8_t *uid,uint8_t *uidLength);//<--here is the error 

#endif 
관련 문제