Fix code style
This commit is contained in:
parent
537dae7913
commit
7d1f586351
1 changed files with 9 additions and 9 deletions
|
@ -97,13 +97,13 @@ int16_t CC1101::begin(float freq, float br, float freqDev, float rxBw, int8_t po
|
||||||
|
|
||||||
void CC1101::reattachGdo0Interrupt()
|
void CC1101::reattachGdo0Interrupt()
|
||||||
{
|
{
|
||||||
if (gdo0action != nullptr)
|
if (gdo0action != nullptr)
|
||||||
Module::attachInterrupt(RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(_mod->getIrq()), gdo0action, gdo0dir);
|
Module::attachInterrupt(RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(_mod->getIrq()), gdo0action, gdo0dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void handleTxInterrupt(void)
|
static void handleTxInterrupt(void)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ int16_t CC1101::transmit(uint8_t* data, size_t len, uint8_t addr) {
|
||||||
// calculate timeout (5ms + 500 % of expected time-on-air)
|
// calculate timeout (5ms + 500 % of expected time-on-air)
|
||||||
uint32_t timeout = 5000000 + (uint32_t)((((float)(len * 8)) / (_br * 1000.0)) * 5000000.0);
|
uint32_t timeout = 5000000 + (uint32_t)((((float)(len * 8)) / (_br * 1000.0)) * 5000000.0);
|
||||||
|
|
||||||
Module::attachInterrupt(RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(_mod->getIrq()), handleTxInterrupt, gdo0dir);
|
Module::attachInterrupt(RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(_mod->getIrq()), handleTxInterrupt, gdo0dir);
|
||||||
|
|
||||||
// start transmission
|
// start transmission
|
||||||
int16_t state = startTransmit(data, len, addr);
|
int16_t state = startTransmit(data, len, addr);
|
||||||
|
@ -136,14 +136,14 @@ int16_t CC1101::transmit(uint8_t* data, size_t len, uint8_t addr) {
|
||||||
Module::yield();
|
Module::yield();
|
||||||
|
|
||||||
if(Module::micros() - start > timeout) {
|
if(Module::micros() - start > timeout) {
|
||||||
reattachGdo0Interrupt();
|
reattachGdo0Interrupt();
|
||||||
standby();
|
standby();
|
||||||
SPIsendCommand(CC1101_CMD_FLUSH_TX);
|
SPIsendCommand(CC1101_CMD_FLUSH_TX);
|
||||||
return(ERR_TX_TIMEOUT);
|
return(ERR_TX_TIMEOUT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
reattachGdo0Interrupt();
|
reattachGdo0Interrupt();
|
||||||
// set mode to standby
|
// set mode to standby
|
||||||
standby();
|
standby();
|
||||||
|
|
||||||
|
@ -229,13 +229,13 @@ int16_t CC1101::packetMode() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void CC1101::setGdo0Action(void (*func)(void), RADIOLIB_INTERRUPT_STATUS dir) {
|
void CC1101::setGdo0Action(void (*func)(void), RADIOLIB_INTERRUPT_STATUS dir) {
|
||||||
gdo0action = func;
|
gdo0action = func;
|
||||||
gdo0dir = dir;
|
gdo0dir = dir;
|
||||||
Module::attachInterrupt(RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(_mod->getIrq()), gdo0action, gdo0dir);
|
Module::attachInterrupt(RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(_mod->getIrq()), gdo0action, gdo0dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CC1101::clearGdo0Action() {
|
void CC1101::clearGdo0Action() {
|
||||||
gdo0action = nullptr;
|
gdo0action = nullptr;
|
||||||
Module::detachInterrupt(RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(_mod->getIrq()));
|
Module::detachInterrupt(RADIOLIB_DIGITAL_PIN_TO_INTERRUPT(_mod->getIrq()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue