fix: correct external function handling
This commit is contained in:
+15
-15
@@ -513,37 +513,37 @@ void CX9261A_setSetPinFunc(CX9261A_SetPinFunc func) {
|
|||||||
|
|
||||||
#ifdef USE_LOGGING
|
#ifdef USE_LOGGING
|
||||||
void CX9261A::logging(const std::string& msg) {
|
void CX9261A::logging(const std::string& msg) {
|
||||||
if(loggingFunc != NULL) {
|
if(loggingFunc == NULL) {
|
||||||
loggingFunc(msg.c_str());
|
|
||||||
}
|
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
return loggingFunc(msg.c_str());
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void CX9261A::writeSpi(int address, int value) {
|
void CX9261A::writeSpi(int address, int value) {
|
||||||
if(writeSpiFunc != NULL) {
|
if(writeSpiFunc == NULL) {
|
||||||
writeSpiFunc(address, value);
|
|
||||||
}
|
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
return writeSpiFunc(address, value);
|
||||||
|
}
|
||||||
|
|
||||||
int CX9261A::readSpi(int address) {
|
int CX9261A::readSpi(int address) {
|
||||||
if(readSpiFunc != NULL) {
|
if(readSpiFunc == NULL) {
|
||||||
return readSpiFunc(address);
|
|
||||||
}
|
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
return readSpiFunc(address);
|
||||||
|
}
|
||||||
|
|
||||||
void CX9261A::pause(double ms) {
|
void CX9261A::pause(double ms) {
|
||||||
if(pauseFunc != NULL) {
|
if(pauseFunc == NULL) {
|
||||||
return pauseFunc(ms);
|
|
||||||
}
|
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
return pauseFunc(ms);
|
||||||
|
}
|
||||||
|
|
||||||
void CX9261A::setPin(int pin, int value) {
|
void CX9261A::setPin(int pin, int value) {
|
||||||
if(setPinFunc != NULL) {
|
if(setPinFunc == NULL) {
|
||||||
return setPinFunc(pin, value);
|
|
||||||
}
|
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
return setPinFunc(pin, value);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user