Skip to content

Commit

Permalink
By review feedback, maintain esp_ as prefix.
Browse files Browse the repository at this point in the history
  • Loading branch information
dok-net committed Oct 13, 2021
1 parent 67ced12 commit 62af940
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cores/esp8266/core_esp8266_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ extern "C" void __esp_delay(unsigned long ms) {

extern "C" void esp_delay(unsigned long ms) __attribute__((weak, alias("__esp_delay")));

bool try_esp_delay(const uint32_t start_ms, const uint32_t timeout_ms, const uint32_t intvl_ms) {
bool esp_try_delay(const uint32_t start_ms, const uint32_t timeout_ms, const uint32_t intvl_ms) {
uint32_t expired = millis() - start_ms;
if (expired >= timeout_ms) {
return true;
Expand Down
4 changes: 2 additions & 2 deletions cores/esp8266/coredecls.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ inline void esp_suspend(T&& blocked) {
// is asynchronously resumed before the timeout is reached.
// Also returns false if intvl_ms have expired during the active call.
// Otherwise return true to indicate the timeout_ms have completely expired.
bool try_esp_delay(const uint32_t start_ms, const uint32_t timeout_ms, const uint32_t intvl_ms);
bool esp_try_delay(const uint32_t start_ms, const uint32_t timeout_ms, const uint32_t intvl_ms);

// This overload of esp_delay() delays for a duration of at most timeout_ms milliseconds.
// Whenever it is resumed, as well as every intvl_ms millisconds, it performs
Expand All @@ -64,7 +64,7 @@ bool try_esp_delay(const uint32_t start_ms, const uint32_t timeout_ms, const uin
template <typename T>
inline void esp_delay(const uint32_t timeout_ms, T&& blocked, const uint32_t intvl_ms) {
const auto start_ms = millis();
while (!try_esp_delay(start_ms, timeout_ms, intvl_ms) && blocked()) {
while (!esp_try_delay(start_ms, timeout_ms, intvl_ms) && blocked()) {
}
}

Expand Down
2 changes: 1 addition & 1 deletion tests/host/common/Arduino.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ extern "C" void esp_delay (unsigned long ms)
usleep(ms * 1000);
}

bool try_esp_delay(const uint32_t start_ms, const uint32_t timeout_ms, const uint32_t intvl_ms) {
bool esp_try_delay(const uint32_t start_ms, const uint32_t timeout_ms, const uint32_t intvl_ms) {
decltype(millis()) expired;

if ((expired = millis() - start_ms) >= timeout_ms) {
Expand Down

0 comments on commit 62af940

Please sign in to comment.