mirror of
https://github.com/airgradienthq/arduino.git
synced 2025-07-13 07:56:32 +02:00
Rename board type 3.7 to 3.3
This commit is contained in:
4
.github/workflows/check.yml
vendored
4
.github/workflows/check.yml
vendored
@ -7,7 +7,7 @@ jobs:
|
|||||||
example:
|
example:
|
||||||
- "BASIC"
|
- "BASIC"
|
||||||
- "DiyProIndoorV4_2"
|
- "DiyProIndoorV4_2"
|
||||||
- "DiyProIndoorV3_7"
|
- "DiyProIndoorV3_3"
|
||||||
- "TestCO2"
|
- "TestCO2"
|
||||||
- "TestPM"
|
- "TestPM"
|
||||||
- "TestSht"
|
- "TestSht"
|
||||||
@ -27,7 +27,7 @@ jobs:
|
|||||||
fqbn: "esp32:esp32:esp32c3"
|
fqbn: "esp32:esp32:esp32c3"
|
||||||
- example: "DiyProIndoorV4_2"
|
- example: "DiyProIndoorV4_2"
|
||||||
fqbn: "esp32:esp32:esp32c3"
|
fqbn: "esp32:esp32:esp32c3"
|
||||||
- example: "DiyProIndoorV3_7"
|
- example: "DiyProIndoorV3_3"
|
||||||
fqbn: "esp32:esp32:esp32c3"
|
fqbn: "esp32:esp32:esp32c3"
|
||||||
- example: "OneOpenAir"
|
- example: "OneOpenAir"
|
||||||
fqbn: "esp8266:esp8266:d1_mini"
|
fqbn: "esp8266:esp8266:d1_mini"
|
||||||
|
@ -53,7 +53,7 @@ CC BY-SA 4.0 Attribution-ShareAlike 4.0 International License
|
|||||||
#define DISPLAY_DELAY_SHOW_CONTENT_MS 2000 /** ms */
|
#define DISPLAY_DELAY_SHOW_CONTENT_MS 2000 /** ms */
|
||||||
#define FIRMWARE_CHECK_FOR_UPDATE_MS (60 * 60 * 1000) /** ms */
|
#define FIRMWARE_CHECK_FOR_UPDATE_MS (60 * 60 * 1000) /** ms */
|
||||||
|
|
||||||
static AirGradient ag(DIY_PRO_INDOOR_V3_7);
|
static AirGradient ag(DIY_PRO_INDOOR_V3_3);
|
||||||
static Configuration configuration(Serial);
|
static Configuration configuration(Serial);
|
||||||
static AgApiClient apiClient(Serial, configuration);
|
static AgApiClient apiClient(Serial, configuration);
|
||||||
static Measurements measurements;
|
static Measurements measurements;
|
||||||
|
@ -153,10 +153,10 @@ void Configuration::defaultConfig(void) {
|
|||||||
jconfig[jprop_pmStandard] = jprop_pmStandard_default;
|
jconfig[jprop_pmStandard] = jprop_pmStandard_default;
|
||||||
jconfig[jprop_temperatureUnit] = jprop_temperatureUnit_default;
|
jconfig[jprop_temperatureUnit] = jprop_temperatureUnit_default;
|
||||||
jconfig[jprop_postDataToAirGradient] = jprop_postDataToAirGradient_default;
|
jconfig[jprop_postDataToAirGradient] = jprop_postDataToAirGradient_default;
|
||||||
if (ag->isOne) {
|
if (ag->isOne()) {
|
||||||
jconfig[jprop_ledBarBrightness] = jprop_ledBarBrightness_default;
|
jconfig[jprop_ledBarBrightness] = jprop_ledBarBrightness_default;
|
||||||
}
|
}
|
||||||
if (ag->isOne() || ag->isPro3_7() || ag->isPro4_2() || ag->isBasic()) {
|
if (ag->isOne() || ag->isPro3_3() || ag->isPro4_2() || ag->isBasic()) {
|
||||||
jconfig[jprop_displayBrightness] = jprop_displayBrightness_default;
|
jconfig[jprop_displayBrightness] = jprop_displayBrightness_default;
|
||||||
}
|
}
|
||||||
if (ag->isOne()) {
|
if (ag->isOne()) {
|
||||||
|
@ -90,7 +90,7 @@ bool OledDisplay::begin(void) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ag->isOne() || ag->isPro3_7() || ag->isPro4_2()) {
|
if (ag->isOne() || ag->isPro3_3() || ag->isPro4_2()) {
|
||||||
/** Create u8g2 instance */
|
/** Create u8g2 instance */
|
||||||
u8g2 = new U8G2_SH1106_128X64_NONAME_F_HW_I2C(U8G2_R0, U8X8_PIN_NONE);
|
u8g2 = new U8G2_SH1106_128X64_NONAME_F_HW_I2C(U8G2_R0, U8X8_PIN_NONE);
|
||||||
if (u8g2 == NULL) {
|
if (u8g2 == NULL) {
|
||||||
@ -133,7 +133,7 @@ void OledDisplay::end(void) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ag->isOne() || ag->isPro3_7() || ag->isPro4_2()) {
|
if (ag->isOne() || ag->isPro3_3() || ag->isPro4_2()) {
|
||||||
/** Free u8g2 */
|
/** Free u8g2 */
|
||||||
delete DISP();
|
delete DISP();
|
||||||
u8g2 = NULL;
|
u8g2 = NULL;
|
||||||
@ -169,7 +169,7 @@ void OledDisplay::setText(const char *line1, const char *line2,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ag->isOne() || ag->isPro3_7() || ag->isPro4_2()) {
|
if (ag->isOne() || ag->isPro3_3() || ag->isPro4_2()) {
|
||||||
DISP()->firstPage();
|
DISP()->firstPage();
|
||||||
do {
|
do {
|
||||||
DISP()->setFont(u8g2_font_t0_16_tf);
|
DISP()->setFont(u8g2_font_t0_16_tf);
|
||||||
@ -218,7 +218,7 @@ void OledDisplay::setText(const char *line1, const char *line2,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ag->isOne() || ag->isPro3_7() || ag->isPro4_2()) {
|
if (ag->isOne() || ag->isPro3_3() || ag->isPro4_2()) {
|
||||||
DISP()->firstPage();
|
DISP()->firstPage();
|
||||||
do {
|
do {
|
||||||
DISP()->setFont(u8g2_font_t0_16_tf);
|
DISP()->setFont(u8g2_font_t0_16_tf);
|
||||||
@ -255,7 +255,7 @@ void OledDisplay::showDashboard(const char *status) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
char strBuf[16];
|
char strBuf[16];
|
||||||
if (ag->isOne() || ag->isPro3_7() || ag->isPro4_2()) {
|
if (ag->isOne() || ag->isPro3_3() || ag->isPro4_2()) {
|
||||||
DISP()->firstPage();
|
DISP()->firstPage();
|
||||||
do {
|
do {
|
||||||
DISP()->setFont(u8g2_font_t0_16_tf);
|
DISP()->setFont(u8g2_font_t0_16_tf);
|
||||||
@ -389,7 +389,7 @@ void OledDisplay::showDashboard(const char *status) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void OledDisplay::setBrightness(int percent) {
|
void OledDisplay::setBrightness(int percent) {
|
||||||
if (ag->isOne() || ag->isPro3_7() || ag->isPro4_2()) {
|
if (ag->isOne() || ag->isPro3_3() || ag->isPro4_2()) {
|
||||||
if (percent == 0) {
|
if (percent == 0) {
|
||||||
isDisplayOff = true;
|
isDisplayOff = true;
|
||||||
|
|
||||||
@ -493,7 +493,7 @@ void OledDisplay::showFirmwareUpdateUpToDate(void) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
void OledDisplay::showRebooting(void) {
|
void OledDisplay::showRebooting(void) {
|
||||||
if (ag->isOne() || ag->isPro3_7() || ag->isPro4_2()) {
|
if (ag->isOne() || ag->isPro3_3() || ag->isPro4_2()) {
|
||||||
DISP()->firstPage();
|
DISP()->firstPage();
|
||||||
do {
|
do {
|
||||||
DISP()->setFont(u8g2_font_t0_16_tf);
|
DISP()->setFont(u8g2_font_t0_16_tf);
|
||||||
|
@ -224,7 +224,7 @@ void StateMachine::co2Calibration(void) {
|
|||||||
|
|
||||||
/** Count down to 0 then start */
|
/** Count down to 0 then start */
|
||||||
for (int i = 0; i < SENSOR_CO2_CALIB_COUNTDOWN_MAX; i++) {
|
for (int i = 0; i < SENSOR_CO2_CALIB_COUNTDOWN_MAX; i++) {
|
||||||
if (ag->isOne() || (ag->isPro4_2()) || ag->isPro3_7()) {
|
if (ag->isOne() || (ag->isPro4_2()) || ag->isPro3_3()) {
|
||||||
String str =
|
String str =
|
||||||
"after " + String(SENSOR_CO2_CALIB_COUNTDOWN_MAX - i) + " sec";
|
"after " + String(SENSOR_CO2_CALIB_COUNTDOWN_MAX - i) + " sec";
|
||||||
disp.setText("Start CO2 calib", str.c_str(), "");
|
disp.setText("Start CO2 calib", str.c_str(), "");
|
||||||
@ -239,7 +239,7 @@ void StateMachine::co2Calibration(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ag->s8.setBaselineCalibration()) {
|
if (ag->s8.setBaselineCalibration()) {
|
||||||
if (ag->isOne() || (ag->isPro4_2()) || ag->isPro3_7()) {
|
if (ag->isOne() || (ag->isPro4_2()) || ag->isPro3_3()) {
|
||||||
disp.setText("Calibration", "success", "");
|
disp.setText("Calibration", "success", "");
|
||||||
} else if (ag->isBasic()) {
|
} else if (ag->isBasic()) {
|
||||||
disp.setText("CO2 Calib", "success", "");
|
disp.setText("CO2 Calib", "success", "");
|
||||||
@ -247,7 +247,7 @@ void StateMachine::co2Calibration(void) {
|
|||||||
logInfo("CO2 Calibration: success");
|
logInfo("CO2 Calibration: success");
|
||||||
}
|
}
|
||||||
delay(1000);
|
delay(1000);
|
||||||
if (ag->isOne() || (ag->isPro4_2()) || ag->isPro3_7()) {
|
if (ag->isOne() || (ag->isPro4_2()) || ag->isPro3_3()) {
|
||||||
disp.setText("Wait for", "calib finish", "...");
|
disp.setText("Wait for", "calib finish", "...");
|
||||||
} else {
|
} else {
|
||||||
logInfo("CO2 Calibration: Wait for calibration finish...");
|
logInfo("CO2 Calibration: Wait for calibration finish...");
|
||||||
@ -259,7 +259,7 @@ void StateMachine::co2Calibration(void) {
|
|||||||
delay(1000);
|
delay(1000);
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
if (ag->isOne() || (ag->isPro4_2()) || ag->isPro3_7()) {
|
if (ag->isOne() || (ag->isPro4_2()) || ag->isPro3_3()) {
|
||||||
String str = "after " + String(count);
|
String str = "after " + String(count);
|
||||||
disp.setText("Calib finish", str.c_str(), "sec");
|
disp.setText("Calib finish", str.c_str(), "sec");
|
||||||
} else {
|
} else {
|
||||||
@ -267,7 +267,7 @@ void StateMachine::co2Calibration(void) {
|
|||||||
}
|
}
|
||||||
delay(2000);
|
delay(2000);
|
||||||
} else {
|
} else {
|
||||||
if (ag->isOne() || (ag->isPro4_2()) || ag->isPro3_7()) {
|
if (ag->isOne() || (ag->isPro4_2()) || ag->isPro3_3()) {
|
||||||
disp.setText("Calibration", "failure!!!", "");
|
disp.setText("Calibration", "failure!!!", "");
|
||||||
} else if(ag->isBasic()) {
|
} else if(ag->isBasic()) {
|
||||||
disp.setText("CO2 calib", "failure!!!", "");
|
disp.setText("CO2 calib", "failure!!!", "");
|
||||||
@ -406,7 +406,7 @@ StateMachine::~StateMachine() {}
|
|||||||
*/
|
*/
|
||||||
void StateMachine::displayHandle(AgStateMachineState state) {
|
void StateMachine::displayHandle(AgStateMachineState state) {
|
||||||
// Ignore handle if not support display
|
// Ignore handle if not support display
|
||||||
if (!(ag->isOne() || (ag->isPro4_2()) || ag->isPro3_7() || ag->isBasic())) {
|
if (!(ag->isOne() || (ag->isPro4_2()) || ag->isPro3_3() || ag->isBasic())) {
|
||||||
if (state == AgStateMachineCo2Calibration) {
|
if (state == AgStateMachineCo2Calibration) {
|
||||||
co2Calibration();
|
co2Calibration();
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ String Measurements::toString(bool localServer, AgFirmwareMode fwMode, int rssi,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ag->isOne() || (ag->isPro4_2()) || ag->isPro3_7() || ag->isBasic()) {
|
if (ag->isOne() || (ag->isPro4_2()) || ag->isPro3_3() || ag->isBasic()) {
|
||||||
if (config->hasSensorPMS1) {
|
if (config->hasSensorPMS1) {
|
||||||
if (this->pm01_1 >= 0) {
|
if (this->pm01_1 >= 0) {
|
||||||
root["pm01"] = this->pm01_1;
|
root["pm01"] = this->pm01_1;
|
||||||
|
@ -49,7 +49,7 @@ bool WifiConnector::connect(void) {
|
|||||||
WIFI()->setSaveConfigCallback([this]() { _wifiSaveConfig(); });
|
WIFI()->setSaveConfigCallback([this]() { _wifiSaveConfig(); });
|
||||||
WIFI()->setSaveParamsCallback([this]() { _wifiSaveParamCallback(); });
|
WIFI()->setSaveParamsCallback([this]() { _wifiSaveParamCallback(); });
|
||||||
WIFI()->setConfigPortalTimeoutCallback([this]() {_wifiTimeoutCallback();});
|
WIFI()->setConfigPortalTimeoutCallback([this]() {_wifiTimeoutCallback();});
|
||||||
if (ag->isOne() || (ag->isPro4_2()) || ag->isPro3_7() || ag->isBasic()) {
|
if (ag->isOne() || (ag->isPro4_2()) || ag->isPro3_3() || ag->isBasic()) {
|
||||||
disp.setText("Connect to", "WiFi", "...");
|
disp.setText("Connect to", "WiFi", "...");
|
||||||
} else {
|
} else {
|
||||||
logInfo("Connecting to WiFi...");
|
logInfo("Connecting to WiFi...");
|
||||||
@ -143,7 +143,7 @@ bool WifiConnector::connect(void) {
|
|||||||
/** Show display wifi connect result failed */
|
/** Show display wifi connect result failed */
|
||||||
if (WiFi.isConnected() == false) {
|
if (WiFi.isConnected() == false) {
|
||||||
sm.handleLeds(AgStateMachineWiFiManagerConnectFailed);
|
sm.handleLeds(AgStateMachineWiFiManagerConnectFailed);
|
||||||
if (ag->isOne() || ag->isPro4_2() || ag->isPro3_7() || ag->isBasic()) {
|
if (ag->isOne() || ag->isPro4_2() || ag->isPro3_3() || ag->isBasic()) {
|
||||||
sm.displayHandle(AgStateMachineWiFiManagerConnectFailed);
|
sm.displayHandle(AgStateMachineWiFiManagerConnectFailed);
|
||||||
}
|
}
|
||||||
delay(6000);
|
delay(6000);
|
||||||
@ -248,7 +248,7 @@ void WifiConnector::_wifiProcess() {
|
|||||||
if (WiFi.isConnected() == false) {
|
if (WiFi.isConnected() == false) {
|
||||||
/** Display countdown */
|
/** Display countdown */
|
||||||
uint32_t ms;
|
uint32_t ms;
|
||||||
if (ag->isOne() || (ag->isPro4_2()) || ag->isPro3_7() || ag->isBasic()) {
|
if (ag->isOne() || (ag->isPro4_2()) || ag->isPro3_3() || ag->isBasic()) {
|
||||||
ms = (uint32_t)(millis() - dispPeriod);
|
ms = (uint32_t)(millis() - dispPeriod);
|
||||||
if (ms >= 1000) {
|
if (ms >= 1000) {
|
||||||
dispPeriod = millis();
|
dispPeriod = millis();
|
||||||
|
@ -62,8 +62,8 @@ bool AirGradient::isPro4_2(void) {
|
|||||||
return boardType == BoardType::DIY_PRO_INDOOR_V4_2;
|
return boardType == BoardType::DIY_PRO_INDOOR_V4_2;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AirGradient::isPro3_7(void) {
|
bool AirGradient::isPro3_3(void) {
|
||||||
return boardType == BoardType::DIY_PRO_INDOOR_V3_7;
|
return boardType == BoardType::DIY_PRO_INDOOR_V3_3;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AirGradient::isBasic(void) { return boardType == BoardType::DIY_BASIC; }
|
bool AirGradient::isBasic(void) { return boardType == BoardType::DIY_BASIC; }
|
||||||
|
@ -147,7 +147,7 @@ public:
|
|||||||
* @return true Yes
|
* @return true Yes
|
||||||
* @return false No
|
* @return false No
|
||||||
*/
|
*/
|
||||||
bool isPro3_7(void);
|
bool isPro3_3(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Check that Airgradient object is DIY_BASIC
|
* @brief Check that Airgradient object is DIY_BASIC
|
||||||
|
@ -322,8 +322,8 @@ const BoardDef bsps[_BOARD_MAX] = {
|
|||||||
},
|
},
|
||||||
.name = "OPEN_AIR_OUTDOOR",
|
.name = "OPEN_AIR_OUTDOOR",
|
||||||
},
|
},
|
||||||
/** DIY_PRO_INDOOR_V3_7 */
|
/** DIY_PRO_INDOOR_V3_3 */
|
||||||
[DIY_PRO_INDOOR_V3_7] =
|
[DIY_PRO_INDOOR_V3_3] =
|
||||||
{
|
{
|
||||||
.SenseAirS8 =
|
.SenseAirS8 =
|
||||||
{
|
{
|
||||||
@ -394,7 +394,7 @@ const BoardDef bsps[_BOARD_MAX] = {
|
|||||||
.resetPin = -1,
|
.resetPin = -1,
|
||||||
.supported = false,
|
.supported = false,
|
||||||
},
|
},
|
||||||
.name = "DIY_PRO_INDOOR_V3_7",
|
.name = "DIY_PRO_INDOOR_V3_3",
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ enum BoardType {
|
|||||||
DIY_PRO_INDOOR_V4_2 = 0x01,
|
DIY_PRO_INDOOR_V4_2 = 0x01,
|
||||||
ONE_INDOOR = 0x02,
|
ONE_INDOOR = 0x02,
|
||||||
OPEN_AIR_OUTDOOR = 0x03,
|
OPEN_AIR_OUTDOOR = 0x03,
|
||||||
DIY_PRO_INDOOR_V3_7 = 0x04,
|
DIY_PRO_INDOOR_V3_3 = 0x04,
|
||||||
_BOARD_MAX
|
_BOARD_MAX
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user