mirror of
https://github.com/arendst/Tasmota.git
synced 2026-03-22 15:07:18 +01:00
Refactor lib RadioLib fixing ESP8266 panic
This commit is contained in:
@@ -289,8 +289,7 @@ int16_t Module::SPItransferStream(uint8_t* cmd, uint8_t cmdLen, bool write, uint
|
||||
} else {
|
||||
uint32_t start = this->hal->millis();
|
||||
while(this->hal->digitalRead(this->gpioPin)) {
|
||||
// this->hal->yield();
|
||||
this->hal->delay(0);
|
||||
this->hal->yield();
|
||||
if(this->hal->millis() - start >= timeout) {
|
||||
RADIOLIB_DEBUG_BASIC_PRINTLN("GPIO pre-transfer timeout, is it connected?");
|
||||
#if !RADIOLIB_STATIC_ONLY
|
||||
@@ -317,8 +316,7 @@ int16_t Module::SPItransferStream(uint8_t* cmd, uint8_t cmdLen, bool write, uint
|
||||
this->hal->delayMicroseconds(1);
|
||||
uint32_t start = this->hal->millis();
|
||||
while(this->hal->digitalRead(this->gpioPin)) {
|
||||
// this->hal->yield();
|
||||
this->hal->delay(0);
|
||||
this->hal->yield();
|
||||
if(this->hal->millis() - start >= timeout) {
|
||||
RADIOLIB_DEBUG_BASIC_PRINTLN("GPIO post-transfer timeout, is it connected?");
|
||||
#if !RADIOLIB_STATIC_ONLY
|
||||
@@ -391,13 +389,11 @@ void Module::waitForMicroseconds(uint32_t start, uint32_t len) {
|
||||
}
|
||||
this->TimerFlag = false;
|
||||
while(!this->TimerFlag) {
|
||||
// this->hal->yield();
|
||||
this->hal->delay(0);
|
||||
this->hal->yield();
|
||||
}
|
||||
#else
|
||||
while(this->hal->micros() - start < len) {
|
||||
// this->hal->yield();
|
||||
this->hal->delay(0);
|
||||
this->hal->yield();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user