Merge pull request #9817 from VergLsm/development

Fixed issue of cannot read data when restart and using Sensor18
This commit is contained in:
Theo Arends 2020-11-14 11:37:05 +01:00 committed by GitHub
commit fede2f0d48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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;