Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
2026-04-22 14:12:32 +08:00
parent ef4eae6128
commit 12904d5507
4 changed files with 29 additions and 9 deletions

View File

@ -79,10 +79,25 @@ uint8_t DS18b20_init()
void getall_temp(float *temp)
{
DS18b20.requestTemperatures(); // Send the command to get temperatures
// vTaskDelay(1000);
for(int8_t i ;i<temp_number;i++)
{
temp[i] = DS18b20.getTempC(p[i]);
// temp[i] = getone_temp(i);
uint32_t n = 0;
while(temp[i] < -110)
{
vTaskDelay(100);
// temp[i] = DS18b20.getTempC(p[i]);
temp[i] = getone_temp(i);
n++;
if (n>40)
{
write_log(log_path,"ds18b20 get temperature failed",10);
// return;
break;
}
}
}
// write_log(log_path,"get temperatures ok",10);