Skip to content

Commit 1d1b846

Browse files
committed
Fix build breakages when using IDF 5
1 parent b70cc82 commit 1d1b846

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

CMakeLists.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
idf_component_register(SRCS "mcp2515.cpp"
2-
INCLUDE_DIRS "include")
2+
INCLUDE_DIRS "include"
3+
REQUIRES driver)

mcp2515.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ MCP2515::ERROR MCP2515::reset(void)
3838
printf("spi_device_transmit failed\n");
3939
}
4040

41-
vTaskDelay(10 / portTICK_RATE_MS);
41+
vTaskDelay(10 / portTICK_PERIOD_MS);
4242

4343
uint8_t zeros[14];
4444
memset(zeros, 0, sizeof(zeros));
@@ -269,14 +269,14 @@ MCP2515::ERROR MCP2515::setOneShotMode(bool set)
269269
if (set)
270270
data = 1U << 3;
271271
modifyRegister(MCP_CANCTRL, 1U << 3, data);
272-
vTaskDelay(10 / portTICK_RATE_MS);
272+
vTaskDelay(10 / portTICK_PERIOD_MS);
273273
bool modeMatch = false;
274274
for (int i = 0; i < 10; i++) {
275275
uint8_t ctrlR = readRegister(MCP_CANCTRL);
276276
modeMatch = (ctrlR & (1U << 3)) == data;
277277
if (modeMatch)
278278
break;
279-
vTaskDelay(10 / portTICK_RATE_MS);
279+
vTaskDelay(10 / portTICK_PERIOD_MS);
280280
}
281281
return modeMatch ? ERROR_OK : ERROR_FAIL;
282282
}
@@ -302,7 +302,7 @@ MCP2515::ERROR MCP2515::setMode(const CANCTRL_REQOP_MODE mode)
302302
break;
303303
}
304304

305-
vTaskDelay(10 / portTICK_RATE_MS);
305+
vTaskDelay(10 / portTICK_PERIOD_MS);
306306
}
307307

308308
return modeMatch ? ERROR_OK : ERROR_FAIL;

0 commit comments

Comments
 (0)