v1.1 tested (TH-05)

This commit is contained in:
pvvx 2024-02-06 05:01:35 +03:00
parent f4bfdb8f9d
commit f47d7540fe
14 changed files with 20 additions and 9252 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -224,7 +224,7 @@ extern const cfg_t def_cfg;
#define FLG_SHOW_TIME 0x00000002 // включить показ часов на LCD
#define FLG_SHOW_SMILEY 0x00000004 // включить показ смайлика
#define FLG_SHOW_TRG 0x00000008 // смайлик поаказывает TRG
#define FLG_ADV_CRYPT 0x00000010 // Зашифрованная BLE реклама (bindkey)
//#define FLG_ADV_CRYPT 0x00000010 // Зашифрованная BLE реклама (bindkey)
typedef struct _adv_work_t {
uint32_t measure_interval_ms;

View file

@ -252,14 +252,16 @@ void chow_measure(void) {
}
} else
#endif // SERVICE_TH_TRG
{
if(measured_data.flg.comfort)
show_smiley(LD_SSYMBOL_HAPPY);
else
show_smiley(LD_SSYMBOL_SAD);
}
#if (DEV_SERVICES & SERVICE_TH_TRG)
} else if(cfg.flg & FLG_SHOW_TRG) {
if(measured_data.flg.trg_on)
show_smiley(LD_SSYMBOL_CC);
show_smiley(LD_SSYMBOL_ALL);
else
show_smiley(LD_SSYMBOL_OFF);
} else

View file

@ -149,7 +149,6 @@ typedef struct _measured_data_t {
int16_t humi; // x 0.01 %
uint16_t battery_mv; // mV
uint8_t battery; // 0..100 %
// uint8_t out_flg; // _measured_flg_t
measured_flg_t flg;
} measured_data_t;
#define send_len_measured_data 10

View file

@ -89,15 +89,15 @@ void set_trigger_out(void) {
}
} else measured_data.flg.humi_trg_on = false;
measured_data.flg.trg_on = measured_data.flg.humi_trg_on || measured_data.flg.humi_trg_on;
measured_data.flg.trg_on = measured_data.flg.temp_trg_on || measured_data.flg.humi_trg_on;
measured_data.flg.trg_output = (trg.cfg & TRG_CFG_OUT_INV)? !measured_data.flg.trg_on : measured_data.flg.trg_on;
#ifdef GPIO_TRG
hal_gpio_fast_write(GPIO_TRG, (trg.cfg & TRG_CFG_OUT_INV)? !measured_data.flg.trg_on : measured_data.flg.trg_on);
hal_gpio_fast_write(GPIO_TRG, measured_data.flg.trg_output);
#endif
#endif
#ifdef GPIO_INP
measured_data.flg.pin_input = hal_gpio_read(GPIO_INP);
#endif
// measured_data.out_flg = *((uint8_t *)&measured_data.flg);
}

View file

@ -979,7 +979,7 @@ var ota_errors = [
function get_msg_ota_err(err) {
if(err == 0)
return "OK";
return "ok";
if(err == 255)
return "OTA end";
if(err <= 11)
@ -1805,7 +1805,6 @@ function ShowGrf(temp, humi) {
digitsAfterDecimal: 3,
});
gu.updateOptions({'file': datau});
$(window).trigger('resize');
} else if (gu_flg == 3)
gu.updateOptions({'file': datau});
}
@ -1885,13 +1884,13 @@ function ShowGrf(temp, humi) {
</tr>
<tr align="center">
<td><!--- надо отдельно, на ходу, при изменении, выводить расчетное значение inputAdvInt*62.5 в ms --->
<input size="4" type="text" id="inputAdvInt" maxlength="4" title="Интервал BLE рекламы в мс, кратность 62.5 мс"></td>
<input size="4" type="text" id="inputAdvInt" maxlength="8" title="Интервал BLE рекламы в мс, кратность 62.5 мс"></td>
<td><!--- надо отдельно выводить расчетное значение inputAdvInt*62.5*inputMeasInt в ms --->
<input size="4" type="text" id="inputMeasInt" maxlength="4" title="Опрос датчика в интервалах BLE рекламы, минимум = 2 интервала рекламы"></td>
<input size="4" type="text" id="inputMeasInt" maxlength="8" title="Опрос датчика в интервалах BLE рекламы, минимум = 2 интервала рекламы"></td>
<td><!--- надо отдельно выводить расчетное значение inputAdvInt*62.5*inputMeasInt*inputAverInt в мс, сек --->
<input size="4" type="text" id="inputAverInt" maxlength="4" title="Запись истории: при 0 - отключена, 1...255 * шаг опроса датчика = интервал записи истории"></td>
<input size="4" type="text" id="inputAverInt" maxlength="8" title="Запись истории: при 0 - отключена, 1...255 * шаг опроса датчика = интервал записи истории"></td>
<td>
<input size="4" type="text" id="inputBatInt" maxlength="4" title="В секундах, минимум 2 секунды, но обрабатывается кратно интервалу BLE рекламы"></td>
<input size="4" type="text" id="inputBatInt" maxlength="8" title="В секундах, минимум 2 секунды, но обрабатывается кратно интервалу BLE рекламы"></td>
</tr>
</table>
<button type="button"id="btnGetDev" onclick="getDevCfg()" >Прочитать</button>
@ -1939,19 +1938,19 @@ function ShowGrf(temp, humi) {
<table id="tbComfort" disabled="true">
<tr>
<td>Комфорт: </td>
<td>Температура от <input size="4" type="text" id="inputTempMin" maxlength="4" title="Минимальная температура">
до <input size="4" type="text" id="inputTempMax" maxlength="4" title="Максимальная температура"> °C,</td>
<td>Влажность от <input size="4" type="text" id="inputHumiMin" maxlength="4" title="Минимальная влажность">
до <input size="4" type="text" id="inputHumiMax" maxlength="4" title="Максимальная влажность"> %RH</td>
<td>Температура от <input size="4" type="text" id="inputTempMin" maxlength="8" title="Минимальная температура">
до <input size="4" type="text" id="inputTempMax" maxlength="8" title="Максимальная температура"> °C,</td>
<td>Влажность от <input size="4" type="text" id="inputHumiMin" maxlength="8" title="Минимальная влажность">
до <input size="4" type="text" id="inputHumiMax" maxlength="8" title="Максимальная влажность"> %RH</td>
</tr>
</table>
<table id="tbTrigger" disabled="true">
<tr>
<td>Триггер: </td>
<td>Температура: <input size="4" type="text" id="inputTempThr" maxlength="4" title="Температура переключения"> °C</td>
<td>Влажность: <input size="4" type="text" id="inputHumiThr" maxlength="4" title="Влажность переключения"> %RH, </td>
<td>Гистерезис: <input size="4" type="text" id="inputTempHsr" maxlength="4" title="Гистерезис температуры"> °C</td>
<td><input size="4" type="text" id="inputHumiHsr" maxlength="4" title="Гистерезис влажности"> %RH</td>
<td>Температура: <input size="4" type="text" id="inputTempThr" maxlength="8" title="Температура переключения"> °C, </td>
<td>Влажность: <input size="4" type="text" id="inputHumiThr" maxlength="8" title="Влажность переключения"> %RH, </td>
<td>Гистерезис: <input size="4" type="text" id="inputTempHsr" maxlength="8" title="Гистерезис температуры"> °C</td>
<td><input size="4" type="text" id="inputHumiHsr" maxlength="8" title="Гистерезис влажности"> %RH, </td>
<td>Инверсия вывода <input type="checkbox" id="chbInvOut"></td>
<td>
</tr>