send commands using correct serial object

This commit is contained in:
gururise 2020-04-08 11:41:10 -07:00
parent 51909679d4
commit ad673bec6c

View File

@ -81,7 +81,7 @@ struct pmsX003data {
size_t PmsSendCmd(uint8_t command_id) size_t PmsSendCmd(uint8_t command_id)
{ {
return MhzSerial->write(kPmsCommands[command_id], sizeof(kPmsCommands[command_id])); return PmsSerial->write(kPmsCommands[command_id], sizeof(kPmsCommands[command_id]));
} }
/*********************************************************************************************/ /*********************************************************************************************/
@ -172,6 +172,7 @@ bool PmsCommandSensor(void)
wake_mode = 1; wake_mode = 1;
pms_ready = 1; pms_ready = 1;
PmsSendCmd(CMD_MODE_ACTIVE); PmsSendCmd(CMD_MODE_ACTIVE);
PmsSendCmd(CMD_WAKEUP);
} }
else if ((XdrvMailbox.payload > 0) && (XdrvMailbox.payload < 256)) else if ((XdrvMailbox.payload > 0) && (XdrvMailbox.payload < 256))
{ {