forked from espressif/arduino-esp32
Removed arduino's delay()
This commit is contained in:
@ -94,7 +94,7 @@ void HardwareSerial::begin(unsigned long baud, uint32_t config, int8_t rxPin, in
|
|||||||
end();
|
end();
|
||||||
|
|
||||||
if(detectedBaudRate) {
|
if(detectedBaudRate) {
|
||||||
delay(100); // Give some time...
|
vTaskDelay(100 / portTICK_PERIOD_MS); // Give some time...
|
||||||
_uart = uartBegin(_uart_nr, detectedBaudRate, config, rxPin, txPin, 256, invert);
|
_uart = uartBegin(_uart_nr, detectedBaudRate, config, rxPin, txPin, 256, invert);
|
||||||
} else {
|
} else {
|
||||||
log_e("Could not detect baudrate. Serial data at the port must be present within the timeout for detection to be possible");
|
log_e("Could not detect baudrate. Serial data at the port must be present within the timeout for detection to be possible");
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
Baudrate detection example usage (detection on Serial1):
|
Baudrate detection example usage (detection on Serial1):
|
||||||
void setup() {
|
void setup() {
|
||||||
Serial.begin(115200);
|
Serial.begin(115200);
|
||||||
delay(100);
|
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||||
Serial.println();
|
Serial.println();
|
||||||
|
|
||||||
Serial1.begin(0, SERIAL_8N1, -1, -1, true, 11000UL); // Passing 0 for baudrate to detect it, the last parameter is a timeout in ms
|
Serial1.begin(0, SERIAL_8N1, -1, -1, true, 11000UL); // Passing 0 for baudrate to detect it, the last parameter is a timeout in ms
|
||||||
|
@ -75,7 +75,7 @@ static size_t tinyusb_cdc_write(uint8_t itf, const uint8_t *buffer, size_t size)
|
|||||||
while(tosend){
|
while(tosend){
|
||||||
uint32_t space = tud_cdc_n_write_available(itf);
|
uint32_t space = tud_cdc_n_write_available(itf);
|
||||||
if(!space){
|
if(!space){
|
||||||
delay(1);
|
vTaskDelay(1 / portTICK_PERIOD_MS);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if(tosend < space){
|
if(tosend < space){
|
||||||
|
@ -1146,7 +1146,7 @@ i2c_err_t i2cProcQueue(i2c_t * i2c, uint32_t *readCount, uint16_t timeOutMillis)
|
|||||||
if(multiMaster){// try to let the bus clear by its self
|
if(multiMaster){// try to let the bus clear by its self
|
||||||
uint32_t timeOutTick = millis();
|
uint32_t timeOutTick = millis();
|
||||||
while((i2c->dev->status_reg.bus_busy)&&(millis()-timeOutTick<timeOutMillis())){
|
while((i2c->dev->status_reg.bus_busy)&&(millis()-timeOutTick<timeOutMillis())){
|
||||||
delay(2); // allow task switch
|
vTaskDelay(2 / portTICK_PERIOD_MS); // allow task switch
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(i2c->dev->status_reg.bus_busy){ // still busy, so die
|
if(i2c->dev->status_reg.bus_busy){ // still busy, so die
|
||||||
|
@ -65,11 +65,6 @@ unsigned long ARDUINO_ISR_ATTR micros()
|
|||||||
return (unsigned long) (esp_timer_get_time());
|
return (unsigned long) (esp_timer_get_time());
|
||||||
}
|
}
|
||||||
|
|
||||||
void delay(uint32_t ms)
|
|
||||||
{
|
|
||||||
vTaskDelay(ms / portTICK_PERIOD_MS);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ARDUINO_ISR_ATTR delayMicroseconds(uint32_t us)
|
void ARDUINO_ISR_ATTR delayMicroseconds(uint32_t us)
|
||||||
{
|
{
|
||||||
uint32_t m = micros();
|
uint32_t m = micros();
|
||||||
|
@ -80,7 +80,6 @@ void yield(void);
|
|||||||
float temperatureRead();
|
float temperatureRead();
|
||||||
|
|
||||||
unsigned long micros();
|
unsigned long micros();
|
||||||
void delay(uint32_t);
|
|
||||||
void delayMicroseconds(uint32_t us);
|
void delayMicroseconds(uint32_t us);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
Reference in New Issue
Block a user