From b7a7221e31dbd7b27bc037721750d727314c3140 Mon Sep 17 00:00:00 2001 From: Matthew Date: Sat, 30 Nov 2024 11:14:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=BF=E7=94=A8=E6=96=B0=E5=AE=9E=E7=8E=B0?= =?UTF-8?q?=E6=8E=A7=E5=88=B6=E7=94=B5=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/cpp/GPIOControl.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 }