Fix tests for edu-riscv64 textbook and edu-arm32 textbook

This commit is contained in:
wgzAIIT
2023-08-23 18:17:04 +08:00
parent a5a809aa0a
commit 355e717cb8
8 changed files with 1351 additions and 380 deletions

View File

@@ -28,10 +28,14 @@ void TvocTb600bTvoc10(void)
{
struct SensorQuantity *tvoc = SensorQuantityFind(SENSOR_QUANTITY_TB600B_TVOC, SENSOR_QUANTITY_TVOC);
SensorQuantityOpen(tvoc);
int32_t result = 0;
result = SensorQuantityReadValue(tvoc);
for(int i = 0; i < 10;i++)
{
PrivTaskDelay(1000);
SensorQuantityReadValue(tvoc);
}
printf("tvoc concentration is : %dppb\n", result);
SensorQuantityClose(tvoc);
}
}
SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0)|SHELL_CMD_TYPE(SHELL_TYPE_CMD_FUNC)|SHELL_CMD_PARAM_NUM(0),tvoc, TvocTb600bTvoc10, read data from tvoc sensor);