Fixed issue of cannot read data when restart and using Sensor18

This commit is contained in:
VergLsm 2020-10-16 00:50:55 +08:00
parent 9ab50db8ef
commit 2e7fd534e0
No known key found for this signature in database
GPG Key ID: 1894BB73BAA8A55E

View File

@ -247,6 +247,14 @@ void PmsInit(void)
if (!PinUsed(GPIO_PMS5003_TX)) { // setting interval not supported if TX pin not connected
Settings.pms_wake_interval = 0;
Pms.ready = 1;
} else {
if (Settings.pms_wake_interval >= MIN_INTERVAL_PERIOD) {
// Passive Mode
PmsSendCmd(CMD_MODE_PASSIVE);
Pms.wake_mode = 0;
Pms.ready = 0;
Pms.time = Settings.pms_wake_interval - WARMUP_PERIOD; // Let it wake up in the next second
}
}
Pms.type = 1;