v2.0 beta6: max adv.interval 15 sec, default 5 sec.

This commit is contained in:
pvvx 2024-12-12 15:01:05 +03:00
parent 145a725707
commit 090a3feabd
29 changed files with 16624 additions and 16631 deletions

View file

@ -160,8 +160,8 @@ void test_config(void) {
#endif
if(cfg.advertising_interval == 0)
cfg.advertising_interval = 1;
else if(cfg.advertising_interval > 160)
cfg.advertising_interval = 160;
// else if(cfg.advertising_interval > 160)
// cfg.advertising_interval = 160;
if(cfg.measure_interval < 2)
cfg.measure_interval = 2;
adv_wrk.measure_interval_ms = (cfg.advertising_interval * cfg.measure_interval * 625) / 10;

View file

@ -46,7 +46,7 @@
#define DEVICE_KEY2 30
#ifndef DEVICE
#define DEVICE DEVICE_KEY2
#define DEVICE DEVICE_THB2
#endif
// supported services by the device (bits)

View file

@ -77,8 +77,8 @@ int read_sensor_cht821x(pdev_i2c_t pi2c_dev) {
uint8_t reg_data[4];
uint32_t _r32;
int16_t _r16;
if (read_i2c_bytes(pi2c_dev, thsensor_cfg.i2c_addr, CHT83xx_REG_TMP, reg_data, 2) == 0
&& read_i2c_bytes(pi2c_dev, thsensor_cfg.i2c_addr, CHT83xx_REG_HMD, &reg_data[2], 2) == 0) {
if (read_i2c_bytes(pi2c_dev, thsensor_cfg.i2c_addr, CHT8215_REG_TMP, reg_data, 2) == 0
&& read_i2c_bytes(pi2c_dev, thsensor_cfg.i2c_addr, CHT8215_REG_HMD, &reg_data[2], 2) == 0) {
_r16 = (reg_data[0] << 8) | reg_data[1];
measured_data.temp = ((int32_t)(_r16 * thsensor_cfg.coef.temp_k) >> 16) + thsensor_cfg.coef.temp_z;; // x 0.01 C
_r32 = ((reg_data[2] << 8) | reg_data[3]); // & 0x7fff;

View file

@ -75,7 +75,7 @@
#define CHT8215_CFG_CONSEC_FQ 0x0006
#define CHT8215_CFG_ATM 0x0001
#define CHT8315_MID 0x5959
#define CHT8215_MID 0x5959
#define CHT8215_VID 0x1582

View file

@ -23,13 +23,9 @@ extern "C"
/*********************************************************************
* CONSTANTS
*/
#if (DEV_SERVICES & SERVICE_BUTTON)
#define DEF_ADV_INERVAL 16000 // = 10 sec, actual time = advInt * 625us
#define DEF_ADV_INERVAL_MS ((DEF_ADV_INERVAL*625)/1000) // 10000 ms
#else
#define DEF_ADV_INERVAL 8000 // = 5 sec, actual time = advInt * 625us
#define DEF_ADV_INERVAL_MS ((DEF_ADV_INERVAL*625)/1000) // 5000 ms
#endif
#define DEF_CON_ADV_INERVAL 2500 // 1.5625 sec
#define DEF_CON_ADV_INERVAL_MS ((DEF_CON_ADV_INERVAL*625)/1000) // 1562 ms
#if (DEV_SERVICES & SERVICE_BUTTON)