esp_timer: return signed timestamp (int64_t)

Since timestamps are 64-bit, loosing one bit of range due to sign does
not present an issue, however for applications doing calculations on
timestamps, signed return type is more convenient.
This commit is contained in:
Ivan Grokhotkov
2017-08-30 11:15:29 +08:00
parent c5632d3012
commit 06af8cd086
3 changed files with 15 additions and 15 deletions

View File

@@ -443,7 +443,7 @@ esp_err_t esp_timer_dump(FILE* stream)
return ESP_OK;
}
uint64_t IRAM_ATTR esp_timer_get_time()
int64_t IRAM_ATTR esp_timer_get_time()
{
return esp_timer_impl_get_time();
return (int64_t) esp_timer_impl_get_time();
}