瀏覽代碼

avoid timeout lock if millis() approaches 2^16

main
PaulStoffregen 9 年之前
父節點
當前提交
7285bbce2d
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. +2
    -2
      utility/Sd2Card.cpp

+ 2
- 2
utility/Sd2Card.cpp 查看文件

@@ -387,7 +387,7 @@ uint8_t Sd2Card::init(uint8_t sckRateID, uint8_t chipSelectPin) {
// command to go idle in SPI mode
while ((status_ = cardCommand(CMD0, 0)) != R1_IDLE_STATE) {
if (((uint16_t)millis() - t0) > SD_INIT_TIMEOUT) {
if (((uint16_t)(millis() - t0)) > SD_INIT_TIMEOUT) {
error(SD_CARD_ERROR_CMD0);
goto fail;
}
@@ -409,7 +409,7 @@ uint8_t Sd2Card::init(uint8_t sckRateID, uint8_t chipSelectPin) {
while ((status_ = cardAcmd(ACMD41, arg)) != R1_READY_STATE) {
// check for timeout
if (((uint16_t)millis() - t0) > SD_INIT_TIMEOUT) {
if (((uint16_t)(millis() - t0)) > SD_INIT_TIMEOUT) {
error(SD_CARD_ERROR_ACMD41);
goto fail;
}

Loading…
取消
儲存