blecsc 0.05: Fix <1 event/second issue

pull/3455/head
Gordon Williams 2024-06-12 11:22:25 +01:00
parent d4d4fb944e
commit a038233fa6
3 changed files with 9 additions and 6 deletions

View File

@ -2,3 +2,4 @@
0.02: Minor code improvements
0.03: Moved from cycling app, fixed connection issues and cadence
0.04: Added support for <1 wheel/crank event/second (using idle counters) (ref #3434)
0.05: Fix <1 event/second issue

View File

@ -119,9 +119,10 @@ class BLECSC {
if (this.lastLwet === undefined) this.lastLwet = this.lwet;
if (this.lwet < this.lastLwet) this.lastLwet -= 65536;
let secs = (this.lwet - this.lastLwet) / 1024;
if (secs)
if (secs) {
this.wrps = (this.cwr - this.lastCwr) / secs;
else {
this.widle = 0;
} else {
if (this.widle<5) this.widle++;
else this.wrps = 0;
}
@ -145,9 +146,10 @@ class BLECSC {
if (this.lastLcet === undefined) this.lastLcet = this.lcet;
if (this.lcet < this.lastLcet) this.lastLcet -= 65536;
let secs = (this.lcet - this.lastLcet) / 1024;
if (secs)
if (secs) {
this.crps = (this.ccr - this.lastCcr) / secs;
else {
this.cidle = 0;
} else {
if (this.cidle<5) this.cidle++;
else this.crps = 0;
}

View File

@ -2,7 +2,7 @@
"id": "blecsc",
"name": "BLE Cycling Speed Sensor Library",
"shortName": "BLE CSC",
"version": "0.04",
"version": "0.05",
"description": "Module to get live values from a BLE Cycle Speed (CSC) sensor. Includes recorder and clockinfo plugins",
"icon": "icons8-cycling-48.png",
"tags": "outdoors,exercise,ble,bluetooth,clkinfo",