diff --git a/ATC_V35.bin b/ATC_V35a.bin similarity index 51% rename from ATC_V35.bin rename to ATC_V35a.bin index 64d2f955..57a635a6 100644 Binary files a/ATC_V35.bin and b/ATC_V35a.bin differ diff --git a/CGG1_v35.bin b/CGG1_v35a.bin similarity index 65% rename from CGG1_v35.bin rename to CGG1_v35a.bin index 7d945c0f..9245836c 100644 Binary files a/CGG1_v35.bin and b/CGG1_v35a.bin differ diff --git a/MHO_C401_v35.bin b/MHO_C401_v35a.bin similarity index 65% rename from MHO_C401_v35.bin rename to MHO_C401_v35a.bin index 983c2ef5..0bd34635 100644 Binary files a/MHO_C401_v35.bin and b/MHO_C401_v35a.bin differ diff --git a/README.md b/README.md index 6ac3f7d5..661cf95d 100644 --- a/README.md +++ b/README.md @@ -145,7 +145,7 @@ In case you want to go back to the original firmware, you can download them here | 3.2 | Added [new encrypted beacon formats](https://github.com/pvvx/ATC_MiThermometer/issues/94#issuecomment-846984018), reed switch maintenance | 3.3 | Added autodetection for [LYWSD03MMC hardware versions B1.6 and B1.9](https://github.com/pvvx/ATC_MiThermometer/issues/125). For CGG1-M and MHO-C401 - autodetection of SHTV3 or SHT4x sensors | 3.4 | Correct Hardware Version Setting for [LYWSD03MMC B1.7](https://github.com/pvvx/ATC_MiThermometer/issues/145) -| 3.5 | Correction of moisture readings for SHT4x sensors. +| 3.5 | Correction of moisture readings for SHT4x sensors. [Rounding off sensor values on display.](https://github.com/pvvx/ATC_MiThermometer/issues/163) ## Applications diff --git a/firmware.json b/firmware.json index cdbca838..d2768866 100644 --- a/firmware.json +++ b/firmware.json @@ -1,3 +1,3 @@ {"version": 53, -"custom":["ATC_V35.bin", "MHO_C401_v35.bin", "CGG1_v35.bin", "ATC_V35.bin", "ATC_V35.bin", "ATC_V35.bin"], +"custom":["ATC_V35a.bin", "MHO_C401_v35a.bin", "CGG1_v35a.bin", "ATC_V35a.bin", "ATC_V35a.bin", "ATC_V35a.bin"], "original":["Original_OTA_Xiaomi_LYWSD03MMC_v1.0.0_0130.bin","Original_OTA_Xiaomi_MHO_C401_v1.0.0_0010.bin","Original_OTA_CGG1_v1.0.1_0093.bin","Original_OTA_Xiaomi_LYWSD03MMC_v1.0.0_0130.bin","Original_OTA_Xiaomi_LYWSD03MMC_v1.0.0_0130.bin","Original_OTA_Xiaomi_LYWSD03MMC_v1.0.0_0130.bin"]} \ No newline at end of file diff --git a/src/app.c b/src/app.c index a6a921f2..c22b4911 100644 --- a/src/app.c +++ b/src/app.c @@ -207,8 +207,8 @@ _attribute_ram_code_ void WakeupLowPowerCb(int par) { rds_input_on(); #endif if(read_sensor_cb()) { - last_temp = measured_data.temp / 10; - last_humi = measured_data.humi / 100; + last_temp = (measured_data.temp + 5)/ 10; + last_humi = (measured_data.humi + 50)/ 100; #if USE_TRIGGER_OUT set_trigger_out(); #endif @@ -435,7 +435,7 @@ _attribute_ram_code_ __attribute__((optimize("-Os"))) void lcd(void) { if (set_small_number_and_bat) { #if DEVICE_TYPE == DEVICE_CGG1 show_battery_symbol(!cfg.flg.show_batt_enabled); - show_small_number(measured_data.humi / 10, 1); + show_small_number((measured_data.humi + 5) / 10, 1); #else show_battery_symbol(0); show_small_number(last_humi, 1); diff --git a/src/ble.c b/src/ble.c index 5a4f7b43..c4172be2 100644 --- a/src/ble.c +++ b/src/ble.c @@ -374,7 +374,7 @@ void set_adv_data() { p->data_id = XIAOMI_DATA_ID_TempAndHumidity & 0xff; // (lo byte XIAOMI_DATA_ID) p->t0d.len = 0x04; p->t0d.temperature = last_temp; // x0.1 C - p->t0d.humidity = measured_data.humi / 10; // x0.1 % + p->t0d.humidity = (measured_data.humi + 5) / 10; // x0.1 % } else { p->data_id = XIAOMI_DATA_ID_Power & 0xff; // (lo byte XIAOMI_DATA_ID) p->t0a.len1 = 1; diff --git a/src/mi_beacon.c b/src/mi_beacon.c index 164dec07..c8ec2235 100644 --- a/src/mi_beacon.c +++ b/src/mi_beacon.c @@ -189,8 +189,8 @@ void atc_encrypt_beacon(uint32_t cnt) { p->head.uid = GAP_ADTYPE_SERVICE_DATA_UUID_16BIT; // 16-bit UUID p->head.UUID = ADV_CUSTOM_UUID16; // GATT Service 0x181A Environmental Sensing (little-endian) (or 0x181C 'User Data'?) p->head.counter = (uint8_t)cnt; - data.temp = measured_data.temp / 50 + 4000 / 50; - data.humi = measured_data.humi / 50; + data.temp = (measured_data.temp + 25) / 50 + 4000 / 50; + data.humi = (measured_data.humi + 25) / 50; data.bat = battery_level | ((trg.flg.trigger_on)? 0x80 : 0); memcpy(&cbn.MAC, mac_public, sizeof(cbn.MAC));