diff --git a/app/src/main/cpp/GPIOControl.h b/app/src/main/cpp/GPIOControl.h index 3177cf3a..451f20eb 100644 --- a/app/src/main/cpp/GPIOControl.h +++ b/app/src/main/cpp/GPIOControl.h @@ -196,18 +196,18 @@ public: static void setBeeOn(bool z) { #ifndef USING_N938 - setInt(CMD_SET_PWM_BEE_STATE, z ? 1 : 0); + z ? TurnOn(CMD_SET_PWM_BEE_STATE) : TurnOff(CMD_SET_PWM_BEE_STATE); #endif } static void setJidianqiState(bool z) { #ifndef USING_N938 - setInt(CMD_SET_ALM_MODE, z ? 1 : 0); + z ? TurnOn(CMD_SET_ALM_MODE) : TurnOff(CMD_SET_ALM_MODE); #endif } static void setSpiPower(bool on) { - setInt(CMD_SET_SPI_POWER, on ? 1 : 0); + on ? TurnOn(CMD_SET_SPI_POWER) : TurnOff(CMD_SET_SPI_POWER); if (on) { std::this_thread::sleep_for(std::chrono::milliseconds(40)); @@ -217,7 +217,7 @@ public: static void setRS485Enable(bool z) { #ifndef USING_N938 - setInt(CMD_SET_485_EN_STATE, z ? 1 : 0); + z ? TurnOn(CMD_SET_485_EN_STATE) : TurnOff(CMD_SET_485_EN_STATE); #endif }