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
|
||||
void CX9261A::logging(const std::string& msg) {
|
||||
if(loggingFunc != NULL) {
|
||||
loggingFunc(msg.c_str());
|
||||
}
|
||||
if(loggingFunc == NULL) {
|
||||
exit(-1);
|
||||
}
|
||||
return loggingFunc(msg.c_str());
|
||||
}
|
||||
#endif
|
||||
|
||||
void CX9261A::writeSpi(int address, int value) {
|
||||
if(writeSpiFunc != NULL) {
|
||||
writeSpiFunc(address, value);
|
||||
}
|
||||
if(writeSpiFunc == NULL) {
|
||||
exit(-1);
|
||||
}
|
||||
return writeSpiFunc(address, value);
|
||||
}
|
||||
|
||||
int CX9261A::readSpi(int address) {
|
||||
if(readSpiFunc != NULL) {
|
||||
return readSpiFunc(address);
|
||||
}
|
||||
if(readSpiFunc == NULL) {
|
||||
exit(-1);
|
||||
}
|
||||
return readSpiFunc(address);
|
||||
}
|
||||
|
||||
void CX9261A::pause(double ms) {
|
||||
if(pauseFunc != NULL) {
|
||||
return pauseFunc(ms);
|
||||
}
|
||||
if(pauseFunc == NULL) {
|
||||
exit(-1);
|
||||
}
|
||||
return pauseFunc(ms);
|
||||
}
|
||||
|
||||
void CX9261A::setPin(int pin, int value) {
|
||||
if(setPinFunc != NULL) {
|
||||
return setPinFunc(pin, value);
|
||||
}
|
||||
if(setPinFunc == NULL) {
|
||||
exit(-1);
|
||||
}
|
||||
return setPinFunc(pin, value);
|
||||
}
|
||||
Reference in New Issue
Block a user