Skip to content

Commit

Permalink
fix requerying of consts
Browse files Browse the repository at this point in the history
  • Loading branch information
pelikhan committed Oct 20, 2023
1 parent ad798e2 commit 43f1853
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,7 @@ namespace jacdac {
if (device && !constHasValues) {
device.query(
this.code,
REGISTER_REFRESH_RATE,
this.isConst ? null : REGISTER_REFRESH_RATE,
this.service.serviceIndex
)
}
Expand Down Expand Up @@ -1443,7 +1443,10 @@ namespace jacdac {
)
}

query(reg: number, refreshRate = 1000, servIdx = 0) {
/**
* @param refreshRate null for const, otherwise ms
*/
query(reg: number, refreshRate: number, servIdx = 0) {
let q = this.lookupQuery(reg, servIdx)
if (!q) this.queries.push((q = new RegQuery(reg, servIdx)))

Expand Down

0 comments on commit 43f1853

Please sign in to comment.